diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-20 19:50:25 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-21 19:09:35 +0200 |
commit | d0f2f0ad3b2ceff10f7dfec2ce64cc58e1dc9262 (patch) | |
tree | 2ba284026717300a11d4c5cadebc3c9f11f18b6d /mesonbuild/mparser.py | |
parent | 5dc32b4af1339f270ba6d0a60e8d41612c31d85b (diff) | |
download | meson-d0f2f0ad3b2ceff10f7dfec2ce64cc58e1dc9262.zip meson-d0f2f0ad3b2ceff10f7dfec2ce64cc58e1dc9262.tar.gz meson-d0f2f0ad3b2ceff10f7dfec2ce64cc58e1dc9262.tar.bz2 |
Newlines in single line strings should only be a warning for now.
Diffstat (limited to 'mesonbuild/mparser.py')
-rw-r--r-- | mesonbuild/mparser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index 2db3375..0e7524c 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -143,7 +143,8 @@ class Lexer: 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) + mlog.warning("""Newline character in a string detected, use ''' (three single quotes) for multiline strings instead. +This will become a hard error in a future Meson release.""", 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()) |