Deal with string escaping
This commit is contained in:
parent
02c5f61bb8
commit
20ed127bf7
2 changed files with 4 additions and 4 deletions
|
@ -1,6 +1,7 @@
|
|||
%import common.WORD
|
||||
%import common.INT
|
||||
%import common.FLOAT
|
||||
%import common.ESCAPED_STRING
|
||||
%import common.WS
|
||||
%ignore WS
|
||||
|
||||
|
|
|
@ -44,10 +44,9 @@ class Block(t.NamedTuple):
|
|||
|
||||
|
||||
class TreeToTuples(lark.Transformer):
|
||||
def string(self, args):
|
||||
# FIXME (arrdem 2021-08-21):
|
||||
# Gonna have to do escape sequences here
|
||||
return args[0].value
|
||||
@lark.v_args(inline=True)
|
||||
def string(self, s):
|
||||
return s[1:-1].replace('\\"', '"')
|
||||
|
||||
def int(self, args):
|
||||
return int(args[0])
|
||||
|
|
Loading…
Reference in a new issue