Update line numbers.
This commit is contained in:
parent
99298c8f72
commit
3bdaceac35
11
builder.py
11
builder.py
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue