fix string to not include doublequotes in value
This commit is contained in:
parent
905448378e
commit
ba80f5d9f7
@ -14,7 +14,6 @@ tokens = [
|
||||
t_LPAREN = r'\('
|
||||
t_RPAREN = r'\)'
|
||||
t_SEMICOLON = r';'
|
||||
t_STRING = r'"([^"])*"'
|
||||
|
||||
t_ignore = ' \t\r'
|
||||
|
||||
@ -23,6 +22,11 @@ def t_ID(t):
|
||||
t.type = reserved.get(t.value, 'ID')
|
||||
return t
|
||||
|
||||
def t_STRING(t):
|
||||
r'"([^"])*"'
|
||||
t.value = t.value[1:-1]
|
||||
return t
|
||||
|
||||
def t_newline(t):
|
||||
r'\n+'
|
||||
t.lexer.lineno += len(t.value)
|
||||
|
Loading…
x
Reference in New Issue
Block a user