dabeaz / ply

Python Lex-Yacc

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation on EOF handling

athos-ribeiro opened this issue · comments

On the EOF handling docs: https://ply.readthedocs.io/en/latest/ply.html#eof-handling

the code example reads:

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

Where it should either have t substituting the occurrences of self or pass self into the signature to make it clear this is a method.