Fix parsing error
This commit is contained in:
@@ -72,11 +72,17 @@ def t_newline(t):
|
||||
# Ignore whitespace
|
||||
t_ignore = ' \t'
|
||||
|
||||
# Comments
|
||||
def t_comment(t):
|
||||
# Single-line comment
|
||||
def t_comment_single(t):
|
||||
r'//.*'
|
||||
pass
|
||||
|
||||
# Multi-line comment
|
||||
def t_comment_multi(t):
|
||||
r'/\*([^*]|\*+[^*/])*\*/'
|
||||
t.lexer.lineno += t.value.count('\n')
|
||||
pass
|
||||
|
||||
# Error handling
|
||||
def t_error(t):
|
||||
print("Illegal character '%s'" % t.value[0])
|
||||
|
||||
Reference in New Issue
Block a user