From 75103efd9f4216084ffb5ca0bf022dede3327e37 Mon Sep 17 00:00:00 2001 From: Volker Weißmann Date: Fri, 22 Sep 2023 17:02:25 +0200 Subject: parser: Fix colno after multiline strings Without this commit, meson thinks that the `var` token in the code below starts at a different column number than it actually starts, because the old author forgot to account for the length of the triple quotes. ``` ''' some multiline strings abc''' + var ``` --- mesonbuild/mparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index 30caf703a..a0a8d273e 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -201,7 +201,7 @@ class Lexer: lines = value.split('\n') if len(lines) > 1: lineno += len(lines) - 1 - line_start = mo.end() - len(lines[-1]) + line_start = mo.end() - len(lines[-1]) - 3 elif tid == 'eol_cont': lineno += 1 line_start = loc -- cgit v1.2.3