bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Side-effect of change to scan-code.l


From: Paul Hilfinger
Subject: Side-effect of change to scan-code.l
Date: Mon, 03 Jan 2011 19:11:36 -0800

I have found a side-effect of commit b9f1d9a47a49c40e8f0a5006b492daba53f25b20,
(which introduced named symbol references). In the current git head
version, a reference such as

         foo : bar { $-1.p(); }

is treated instead as

         foo : bar { $-1(); }

I'm guessing this is because of the lexical syntax given for a
reference:

  "$"("<"{tag}">")?{ref}  

where 'ref' is defined 

  letter  [-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
  id      {letter}({letter}|[0-9])*
  ref  -?[0-9]+|{id}|"["{id}"]"|"$"

As you can see, this matches $-1.p, but only matches the '$1' part of
$1.p, so that $1.p() gets handled as I had expected.

This is minor, and easily worked around with ($-1).p(), but it is
inconsistent with previous behavior.

It seems a bit annoying to fix (since it is not clear what an identifier
ought to be), but perhaps

  letter  [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_]
  id      {letter}({letter}|[-0-9])*
  ref     -?[0-9]+|{id}|"["{id}"]"|"$"
  
?

Paul Hilfinger



reply via email to

[Prev in Thread] Current Thread [Next in Thread]