aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-06-08 19:02:45 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-06-08 19:02:45 +0300
commit6951abe1928ba4f5e9178446d6906eefb9f5df3c (patch)
tree036335b47616315fba4b2aa7254961808d40c84c
parent414c5f8c497bacaf2d70ec1b992c7e828b775eaf (diff)
downloadmeson-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.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mparser.py b/mparser.py
index 7d56c8b..6d6eb4d 100644
--- a/mparser.py
+++ b/mparser.py
@@ -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")