aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mparser.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 94d56e5..2db3375 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -141,6 +141,9 @@ class Lexer:
elif tid == 'dblquote':
raise ParseException('Double quotes are not supported. Use single quotes.', self.getline(line_start), lineno, col)
elif tid == 'string':
+ # Handle here and not on the regexp to give a better error message.
+ if match_text.find("\n") != -1:
+ raise ParseException("Use ''' (three single quotes) for multiline strings.", self.getline(line_start), lineno, col)
value = match_text[1:-1].replace(r"\'", "'")
value = newline_rx.sub(r'\1\n', value)
value = value.replace(r" \\ ".strip(), r" \ ".strip())