In attempting to upgrade from version 2.3 to 2.5 of Ply I found a
difference which does not seem to be mentioned in the documentation.

Running the code below produces a different answer on 2.3 and 2.5. On
2.3 it prints A, on 2.5 it prints B. Reading the documentation implies
that 2.3 is correct and 2.5 is wrong.

from ply import lex, yacc

t_A = 'A'
t_B = 'B'
t_C = 'C'

tokens = ('A', 'B', 'C')

the_lexer = lex.lex()

def p_start(t):
   '''start : A nest C'''

def p_nest(t):
    '''nest : B'''
    print t[-1]

the_parser = yacc.yacc(debug = False, write_tables = False)

the_parser.parse('ABC', the_lexer)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ply-hack" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/ply-hack?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to