Update line numbers.

This commit is contained in:
Jussi Pakkanen 2012-12-23 18:57:50 +02:00
parent 99298c8f72
commit 3bdaceac35
1 changed files with 9 additions and 2 deletions

View File

@ -45,11 +45,18 @@ t_COMMENT = '\#[^\n]*'
t_COMMA = ',' t_COMMA = ','
t_DOT = '\.' t_DOT = '\.'
t_STRING = "'[^']*'" t_STRING = "'[^']*'"
t_EOL_CONTINUE = r'\\[ \t]*\n'
t_EOL = r'\n'
t_ignore = ' \t' t_ignore = ' \t'
def t_EOL(t):
r'\n'
t.lexer.lineno += 1
return t
def t_EOL_CONTINUE(t):
r'\\[ \t]*\n'
t.lexer.lineno += 1
def t_error(t): def t_error(t):
print("Illegal character '%s'" % t.value[0]) print("Illegal character '%s'" % t.value[0])
t.lexer.skip(1) t.lexer.skip(1)