thanks, one last question, how would you print out a string containing
characters like "\n"?

On Oct 11, 8:35 pm, Andrew Dalke <[email protected]> wrote:
> On Oct 11, 2009, at 7:12 PM, matio wrote:
>
> > def t_NAME(t):
> >     r'[a-zA-Z_][a-zA-Z0-9_]*'
> >     t.value = reserved.get(t.value, 'NAME')
> >     return t
>    ...
> > is run it says:
>
> > Syntax error at 'NAME'
>
> That's because you changed all NAME tokens to have the value of NAME.  
> You really want to change the type. Change "t.value" to "t.type" so  
> the assignment becomes
>
>       t.type = reserved.get(t.value, 'NAME')
>
>                                 Andrew
>                                 [email protected]
--~--~---------~--~----~------------~-------~--~----~
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