diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-20 19:50:25 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-20 19:50:25 +0200 |
commit | 8dd9380e2f0ac9f6ad6dd409d32aa9e780b0bdd3 (patch) | |
tree | 727446babd2c160677a9055efd72ca7e96cfdd7d | |
parent | 8842839bb4c8dadaba1808535928ede7527d5b53 (diff) | |
download | meson-revertnlerror.tar.gz |
Newlines in single line strings should only be a warning for now.revertnlerror
-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 2db3375fa..0e7524c3c 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()) |