diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-06-08 19:02:45 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-06-08 19:02:45 +0300 |
commit | 6951abe1928ba4f5e9178446d6906eefb9f5df3c (patch) | |
tree | 036335b47616315fba4b2aa7254961808d40c84c | |
parent | 414c5f8c497bacaf2d70ec1b992c7e828b775eaf (diff) | |
download | meson-6951abe1928ba4f5e9178446d6906eefb9f5df3c.zip meson-6951abe1928ba4f5e9178446d6906eefb9f5df3c.tar.gz meson-6951abe1928ba4f5e9178446d6906eefb9f5df3c.tar.bz2 |
Give clear error message if someone tries to use double quotes. Closes #144.
-rw-r--r-- | mparser.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -50,6 +50,7 @@ class Lexer: ('rparen', re.compile(r'\)')), ('lbracket', re.compile(r'\[')), ('rbracket', re.compile(r'\]')), + ('dblquote', re.compile(r'"')), ('string', re.compile(r"'([^'\\]|(\\.))*'")), ('comma', re.compile(r',')), ('dot', re.compile(r'\.')), @@ -91,6 +92,8 @@ class Lexer: bracket_count += 1 elif tid == 'rbracket': bracket_count -= 1 + elif tid == 'dblquote': + raise ParseException('Double quotes are not supported. Use single quotes.', lineno, col) elif tid == 'string': value = match_text[1:-1].replace(r"\'", "'").replace(r" \\ ".strip(), r" \ ".strip())\ .replace("\\n", "\n") |