From c8ae5a4dbb6768c524b992b539842172057e7b70 Mon Sep 17 00:00:00 2001 From: mryouse Date: Sat, 11 Jun 2022 22:45:01 +0000 Subject: bugfix: support escaped double quotes in strings --- lexer.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lexer.py b/lexer.py index eaeccec..0a634c5 100644 --- a/lexer.py +++ b/lexer.py @@ -126,7 +126,15 @@ def get_string(data, line): while data[counter] != '"': if data[counter] == "\n": offset += 1 - string += data[counter] + + # look ahead to see if it's a double quote + if data[counter] == "\\" and \ + len(data) > counter and \ + data[counter+1] == '"': + string += '"' + counter += 1 + else: + string += data[counter] counter += 1 if counter >= len(data): raise Exception("couldn't parse string") -- cgit v1.2.3