diff options
author | David Beazley <dave@dabeaz.com> | 2007-11-29 18:52:12 +0000 |
---|---|---|
committer | David Beazley <dave@dabeaz.com> | 2007-11-29 18:52:12 +0000 |
commit | 616ca1b0ecff62b8725ee5c21a091376d210b139 (patch) | |
tree | dd12277f70c92c9c22c6351b07b94b2059046e1c | |
parent | d84f56a3ba16d7685d91577e96d0ba06448f8b68 (diff) | |
download | ply-616ca1b0ecff62b8725ee5c21a091376d210b139.tar.gz |
*** empty log message ***
-rw-r--r-- | CHANGES | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1,5 +1,22 @@ Version 2.4 ----------------------------- +11/29/07: beazley + Modification of ply.lex to allow token functions to aliased. + This is subtle, but it makes it easier to create libraries and + to reuse token specifications. For example, suppose you defined + a function like this: + + def number(t): + r'\d+' + t.value = int(t.value) + return t + + This change would allow you to define a token rule as follows: + + t_NUMBER = number + + In this case, the token type will be set to 'NUMBER'. + 11/28/07: beazley Slight modification to lex and yacc to grab symbols from both the local and global dictionaries of the caller. This |