diff --git a/projects/lilith/src/python/lilith/grammar.lark b/projects/lilith/src/python/lilith/grammar.lark index 4ea9440..3d88fa1 100644 --- a/projects/lilith/src/python/lilith/grammar.lark +++ b/projects/lilith/src/python/lilith/grammar.lark @@ -1,6 +1,7 @@ %import common.WORD %import common.INT %import common.FLOAT +%import common.ESCAPED_STRING %import common.WS %ignore WS diff --git a/projects/lilith/src/python/lilith/parser.py b/projects/lilith/src/python/lilith/parser.py index 0024435..a351cf8 100644 --- a/projects/lilith/src/python/lilith/parser.py +++ b/projects/lilith/src/python/lilith/parser.py @@ -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])