summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorCharles Brunet <charles.brunet@optelgroup.com>2023-08-23 15:39:43 -0400
committerCharles Brunet <charles.brunet@optelgroup.com>2023-09-11 07:51:19 -0400
commit14e35b63c02a16f69dd1ad5bde775e6868965eb2 (patch)
tree36383a4993013cb22fc390e8224822906d9610ae /mesonbuild
parentd3a26d158e4607ce677404920ad72508eb6f9de2 (diff)
downloadmeson-14e35b63c02a16f69dd1ad5bde775e6868965eb2.tar.gz
parser: allow whitespaces and comments in cont_eol
FIXME: another approach would be to consider cont_eol as comment (i.e. add backslash and whitespaces to the comment regex). In both cases it works until we want to parse comments separately. TODO?: handle eol_cont inside a string (to split long string without breaking lines). Probably a bad idea and better to simply join a multiline string.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/mparser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index a161842e6..0f63c9e5a 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -121,7 +121,7 @@ class Lexer:
('fstring', re.compile(r"f'([^'\\]|(\\.))*'")),
('id', re.compile('[_a-zA-Z][_0-9a-zA-Z]*')),
('number', re.compile(r'0[bB][01]+|0[oO][0-7]+|0[xX][0-9a-fA-F]+|0|[1-9]\d*')),
- ('eol_cont', re.compile(r'\\\n')),
+ ('eol_cont', re.compile(r'\\[ \t]*(#.*)?\n')),
('eol', re.compile(r'\n')),
('multiline_string', re.compile(r"'''(.|\n)*?'''", re.M)),
('comment', re.compile(r'#.*')),