Fix string literal has quotes

master
Yury Kurlykov 2020-06-28 16:48:35 +10:00
parent 9f0646c6f0
commit e7f1cc89b9
Signed by: t1meshift
GPG Key ID: B133F3167ABF94D8
1 changed files with 2 additions and 1 deletions

View File

@ -86,7 +86,8 @@ class LiteralListener(JSBaseListener):
value = ctx.BooleanLiteral().getText() == "true" value = ctx.BooleanLiteral().getText() == "true"
self._literal = nodes.BooleanLiteral(loc, value) self._literal = nodes.BooleanLiteral(loc, value)
elif ctx.StringLiteral() is not None: elif ctx.StringLiteral() is not None:
self._literal = nodes.StringLiteral(loc, ctx.StringLiteral().getText()) value = ctx.StringLiteral().getText()[1:-1] # Strip quotes
self._literal = nodes.StringLiteral(loc, value)
else: else:
ctx.getChild(0).enterRule(self) ctx.getChild(0).enterRule(self)