diff options
| author | mryouse | 2022-06-11 22:45:01 +0000 |
|---|---|---|
| committer | mryouse | 2022-06-11 22:45:01 +0000 |
| commit | c8ae5a4dbb6768c524b992b539842172057e7b70 (patch) | |
| tree | f885be0df4d6c84594c8f7ff340ee76d79813f5d | |
| parent | fd0be36c64c7e7e6be927f701ff2bf08c0ffe974 (diff) | |
bugfix: support escaped double quotes in strings
| -rw-r--r-- | lexer.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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") |
