dabeaz / ply

Python Lex-Yacc

Home Page:http://www.dabeaz.com/ply/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple typo in doc/ply.md about error handler example

doombeaker opened this issue · comments

the code https://github.com/dabeaz/ply/blob/master/doc/ply.md?plain=1#L480-L481

now :

    def t_eof(t):
        # Get more input (Example)
        more = input('... ')
        if more:
            self.lexer.input(more)
            return self.lexer.token()
        return None

The self here seems should be t (token).
should be:

    def t_eof(t):
        # Get more input (Example)
        more = input('... ')
        if more:
            t.lexer.input(more)
            return t.lexer.token()
        return None

Fixed.