Repository: mesonbuild/meson

Issue:
Syntax issues are confusingly attributed to the start of the clause rather than the offending atom's position
**Describe the bug**

When a syntax issue occurs, the parser is currently billing the start of a semantic structure, instead of the offending atom's position.

This causes, for instance, mismatched `elif`s to be billed to the start of the `if` clause instead of the position of the actual broken `elif`.

**To Reproduce**

meson.build:

```meson
project('test', 'c')

CMDLINE_SELECT = [
    'help',
    'apple',
]

IGNORE_MESON_BUILTINS = [
    'help',
]

MESON_OPTIONS = [

]

foreach flag: CMDLINE_SELECT
	if IGNORE_MESON_BUILTINS.contains(flag)
		continue
	elif MESON_OPTIONS.contains(flag)
		value = get_option(flag)
		if value != 'unset'
			features.set(flag, value)
		endif
	elif
		error('Unhandled option @0@'.format(flag))
	endif
endforeach

```

**Expected behavior**

Compilation will fail, but it should bill line 24 and not 17:

```
meson.build:17:26: ERROR: Unknown statement.
```

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)? **Native**
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) **Windows 10 21H2**
* what Python version are you using e.g. 3.8.0 **3.10.7**
* what `meson --version`  **1.0.1**
* what `ninja --version` if it's a Ninja build **1.10.2.git.kitware.jobserver-1**



Discussion:
I have a fix. The problem was that we sometimes update the node we are processing, but the error handler wasn't updated too. I now get:
```
meson.build:24:5: ERROR: Unknown statement.
```

Resolving patch:
diff --git a/mesonbuild/interpreterbase/interpreterbase.py b/mesonbuild/interpreterbase/interpreterbase.py
--- a/mesonbuild/interpreterbase/interpreterbase.py
+++ b/mesonbuild/interpreterbase/interpreterbase.py
@@ -183,8 +183,9 @@ def evaluate_codeblock(self, node: mparser.CodeBlockNode, start: int = 0, end: T
             except Exception as e:
                 if getattr(e, 'lineno', None) is None:
                     # We are doing the equivalent to setattr here and mypy does not like it
-                    e.lineno = cur.lineno                                                             # type: ignore
-                    e.colno = cur.colno                                                               # type: ignore
+                    # NOTE: self.current_node is continually updated during processing
+                    e.lineno = self.current_node.lineno                                               # type: ignore
+                    e.colno = self.current_node.colno                                                 # type: ignore
                     e.file = os.path.join(self.source_root, self.subdir, environment.build_filename)  # type: ignore
                 raise e
             i += 1 # In THE FUTURE jump over blocks and stuff.
@@ -516,6 +517,7 @@ def function_call(self, node: mparser.FunctionNode) -> T.Optional[InterpreterObj
                 func_args = flatten(posargs)
             if not getattr(func, 'no-second-level-holder-flattening', False):
                 func_args, kwargs = resolve_second_level_holders(func_args, kwargs)
+            self.current_node = node
             res = func(node, func_args, kwargs)
             return self._holderify(res) if res is not None else None
         else:
@@ -544,7 +546,7 @@ def method_call(self, node: mparser.MethodNode) -> T.Optional[InterpreterObject]
                 self.validate_extraction(obj.held_object)
             elif not isinstance(obj, Disabler):
                 raise InvalidArguments(f'Invalid operation "extract_objects" on {object_display_name} of type {type(obj).__name__}')
-        obj.current_node = node
+        obj.current_node = self.current_node = node
         res = obj.method_call(method_name, args, kwargs)
         return self._holderify(res) if res is not None else None
 
@@ -598,6 +600,7 @@ def reduce_arguments(
             reduced_val = self.evaluate_statement(val)
             if reduced_val is None:
                 raise InvalidArguments(f'Value of key {reduced_key} is void.')
+            self.current_node = key
             if duplicate_key_error and reduced_key in reduced_kw:
                 raise InvalidArguments(duplicate_key_error.format(reduced_key))
             reduced_kw[reduced_key] = reduced_val


Test patch:
diff --git a/run_project_tests.py b/run_project_tests.py
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -289,6 +289,7 @@ def __lt__(self, other: object) -> bool:
 failing_logs: T.List[str] = []
 print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ
 under_ci = 'CI' in os.environ
+ci_is_github = 'GITHUB_ACTIONS' in os.environ
 raw_ci_jobname = os.environ.get('MESON_CI_JOBNAME', None)
 ci_jobname = raw_ci_jobname if raw_ci_jobname != 'thirdparty' else None
 do_debug = under_ci or print_debug
@@ -420,11 +421,16 @@ def log_text_file(logfile: T.TextIO, testdir: Path, result: TestResult) -> None:
 
 
 def _run_ci_include(args: T.List[str]) -> str:
+    header = f'Included file {args[0]}:'
+    footer = ''
+    if ci_is_github:
+        header = f'::group::==== {header} ===='
+        footer = '::endgroup::'
     if not args:
         return 'At least one parameter required'
     try:
         data = Path(args[0]).read_text(errors='ignore', encoding='utf-8')
-        return 'Included file {}:\n{}\n'.format(args[0], data)
+        return f'{header}\n{data}\n{footer}'
     except Exception:
         return 'Failed to open {}'.format(args[0])
 
diff --git a/test cases/common/44 pkgconfig-gen/test.json b/test cases/common/44 pkgconfig-gen/test.json
--- a/test cases/common/44 pkgconfig-gen/test.json	
+++ b/test cases/common/44 pkgconfig-gen/test.json	
@@ -19,7 +19,7 @@
   ],
   "stdout": [
     {
-      "line": "test cases/common/44 pkgconfig-gen/meson.build:164: WARNING: Project targets '>=0.60.0' but uses feature introduced in '0.62.0': pkgconfig.generate implicit variable for builtin directories."
+      "line": "test cases/common/44 pkgconfig-gen/meson.build:160: WARNING: Project targets '>=0.60.0' but uses feature introduced in '0.62.0': pkgconfig.generate implicit variable for builtin directories."
     },
     {
       "line": "test cases/common/44 pkgconfig-gen/meson.build:170: WARNING: Project targets '>=0.60.0' but uses feature introduced in '0.62.0': pkgconfig.generate implicit variable for builtin directories.",
diff --git a/test cases/failing/10 out of bounds/test.json b/test cases/failing/10 out of bounds/test.json
--- a/test cases/failing/10 out of bounds/test.json	
+++ b/test cases/failing/10 out of bounds/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/10 out of bounds/meson.build:4:0: ERROR: Index 0 out of bounds of array of size 0."
+      "line": "test cases/failing/10 out of bounds/meson.build:4:6: ERROR: Index 0 out of bounds of array of size 0."
     }
   ]
 }
diff --git a/test cases/failing/100 no glib-compile-resources/test.json b/test cases/failing/100 no glib-compile-resources/test.json
--- a/test cases/failing/100 no glib-compile-resources/test.json	
+++ b/test cases/failing/100 no glib-compile-resources/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/100 no glib-compile-resources/meson.build:8:0: ERROR: Program 'glib-compile-resources' not found or not executable"
+      "line": "test cases/failing/100 no glib-compile-resources/meson.build:8:12: ERROR: Program 'glib-compile-resources' not found or not executable"
     }
   ]
 }
diff --git a/test cases/failing/104 no fallback/test.json b/test cases/failing/104 no fallback/test.json
--- a/test cases/failing/104 no fallback/test.json	
+++ b/test cases/failing/104 no fallback/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "match": "re",
-      "line": ".*/meson\\.build:2:0: ERROR: (Pkg-config binary for machine MachineChoice\\.HOST not found\\. Giving up\\.|Dependency \"foob\" not found, tried .*)"
+      "line": ".*/meson\\.build:2:11: ERROR: (Pkg-config binary for machine MachineChoice\\.HOST not found\\. Giving up\\.|Dependency \"foob\" not found, tried .*)"
     }
   ]
 }
diff --git a/test cases/failing/105 feature require/test.json b/test cases/failing/105 feature require/test.json
--- a/test cases/failing/105 feature require/test.json	
+++ b/test cases/failing/105 feature require/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "match": "re",
-      "line": ".*/meson\\.build:2:0: ERROR: Feature reqfeature cannot be enabled: frobnicator not available"
+      "line": ".*/meson\\.build:2:31: ERROR: Feature reqfeature cannot be enabled: frobnicator not available"
     }
   ]
 }
diff --git a/test cases/failing/106 feature require.bis/test.json b/test cases/failing/106 feature require.bis/test.json
--- a/test cases/failing/106 feature require.bis/test.json	
+++ b/test cases/failing/106 feature require.bis/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "match": "re",
-      "line": ".*/meson\\.build:2:0: ERROR: Feature reqfeature cannot be enabled"
+      "line": ".*/meson\\.build:2:31: ERROR: Feature reqfeature cannot be enabled"
     }
   ]
 }
diff --git a/test cases/failing/107 no build get_external_property/test.json b/test cases/failing/107 no build get_external_property/test.json
--- a/test cases/failing/107 no build get_external_property/test.json	
+++ b/test cases/failing/107 no build get_external_property/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/107 no build get_external_property/meson.build:3:0: ERROR: Unknown property for build machine: nonexisting"
+      "line": "test cases/failing/107 no build get_external_property/meson.build:3:14: ERROR: Unknown property for build machine: nonexisting"
     }
   ]
 }
diff --git a/test cases/failing/109 invalid fstring/test.json b/test cases/failing/109 invalid fstring/test.json
--- a/test cases/failing/109 invalid fstring/test.json	
+++ b/test cases/failing/109 invalid fstring/test.json	
@@ -1,7 +1,7 @@
 {
     "stdout": [
         {
-            "line": "test cases/failing/109 invalid fstring/meson.build:3:0: ERROR: Identifier \"foo\" does not name a variable."
+            "line": "test cases/failing/109 invalid fstring/meson.build:3:4: ERROR: Identifier \"foo\" does not name a variable."
         }
     ]
 }
diff --git a/test cases/failing/11 object arithmetic/test.json b/test cases/failing/11 object arithmetic/test.json
--- a/test cases/failing/11 object arithmetic/test.json	
+++ b/test cases/failing/11 object arithmetic/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "match": "re",
-      "line": "test cases/failing/11 object arithmetic/meson\\.build:3:0: ERROR: The `\\+` operator of str does not accept objects of type MesonMain .*"
+      "line": "test cases/failing/11 object arithmetic/meson\\.build:3:12: ERROR: The `\\+` operator of str does not accept objects of type MesonMain .*"
     }
   ]
 }
diff --git a/test cases/failing/110 compiler argument checking/test.json b/test cases/failing/110 compiler argument checking/test.json
--- a/test cases/failing/110 compiler argument checking/test.json	
+++ b/test cases/failing/110 compiler argument checking/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-        "line": "test cases/failing/110 compiler argument checking/meson.build:4:0: ERROR: Compiler for C does not support \"-meson-goober-arg-for-testing\""
+        "line": "test cases/failing/110 compiler argument checking/meson.build:4:25: ERROR: Compiler for C does not support \"-meson-goober-arg-for-testing\""
     }
   ]
 }
diff --git a/test cases/failing/112 cmake executable dependency/test.json b/test cases/failing/112 cmake executable dependency/test.json
--- a/test cases/failing/112 cmake executable dependency/test.json	
+++ b/test cases/failing/112 cmake executable dependency/test.json	
@@ -1,7 +1,7 @@
 {
     "stdout": [
         {
-            "line": "test cases/failing/112 cmake executable dependency/meson.build:9:0: ERROR: main is an executable and does not support the dependency() method. Use target() instead."
+            "line": "test cases/failing/112 cmake executable dependency/meson.build:9:14: ERROR: main is an executable and does not support the dependency() method. Use target() instead."
         }
     ],
     "tools": {
diff --git a/test cases/failing/118 subproject version conflict/test.json b/test cases/failing/118 subproject version conflict/test.json
--- a/test cases/failing/118 subproject version conflict/test.json	
+++ b/test cases/failing/118 subproject version conflict/test.json	
@@ -1,7 +1,7 @@
 {
     "stdout": [
         {
-            "line": "test cases/failing/118 subproject version conflict/meson.build:4:0: ERROR: Subproject B version is 100 but ['1'] required."
+            "line": "test cases/failing/118 subproject version conflict/meson.build:4:8: ERROR: Subproject B version is 100 but ['1'] required."
         }
     ]
 }
diff --git a/test cases/failing/119 structured source empty string/test.json b/test cases/failing/119 structured source empty string/test.json
--- a/test cases/failing/119 structured source empty string/test.json	
+++ b/test cases/failing/119 structured source empty string/test.json	
@@ -1,7 +1,7 @@
 {
     "stdout": [
         {
-            "line": "test cases/failing/119 structured source empty string/meson.build:7:0: ERROR: structured_sources: keys to dictionary argument may not be an empty string."
+            "line": "test cases/failing/119 structured source empty string/meson.build:9:2: ERROR: structured_sources: keys to dictionary argument may not be an empty string."
         }
     ]
 }
diff --git a/test cases/failing/12 string arithmetic/test.json b/test cases/failing/12 string arithmetic/test.json
--- a/test cases/failing/12 string arithmetic/test.json	
+++ b/test cases/failing/12 string arithmetic/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/12 string arithmetic/meson.build:3:0: ERROR: The `+` operator of str does not accept objects of type int (3)"
+      "line": "test cases/failing/12 string arithmetic/meson.build:3:12: ERROR: The `+` operator of str does not accept objects of type int (3)"
     }
   ]
 }
diff --git a/test cases/failing/122 cmake subproject error/test.json b/test cases/failing/122 cmake subproject error/test.json
--- a/test cases/failing/122 cmake subproject error/test.json	
+++ b/test cases/failing/122 cmake subproject error/test.json	
@@ -1,7 +1,7 @@
 {
     "stdout": [
         {
-            "line": "test cases/failing/122 cmake subproject error/meson.build:8:0: ERROR: Failed to configure the CMake subproject: Fancy error message"
+            "line": "test cases/failing/122 cmake subproject error/meson.build:8:14: ERROR: Failed to configure the CMake subproject: Fancy error message"
         }
     ],
     "tools": {
diff --git a/test cases/failing/127 extract from unity/test.json b/test cases/failing/127 extract from unity/test.json
--- a/test cases/failing/127 extract from unity/test.json	
+++ b/test cases/failing/127 extract from unity/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/127 extract from unity/meson.build:4:0: ERROR: Single object files can not be extracted in Unity builds. You can only extract all the object files for each compiler at once."
+      "line": "test cases/failing/127 extract from unity/meson.build:4:37: ERROR: Single object files can not be extracted in Unity builds. You can only extract all the object files for each compiler at once."
     }
   ]
 }
diff --git a/test cases/failing/13 array arithmetic/test.json b/test cases/failing/13 array arithmetic/test.json
--- a/test cases/failing/13 array arithmetic/test.json	
+++ b/test cases/failing/13 array arithmetic/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/13 array arithmetic/meson.build:3:0: ERROR: Object <[ArrayHolder] holds [list]: ['a', 'b']> of type array does not support the `*` operator."
+      "line": "test cases/failing/13 array arithmetic/meson.build:3:19: ERROR: Object <[ArrayHolder] holds [list]: ['a', 'b']> of type array does not support the `*` operator."
     }
   ]
 }
diff --git a/test cases/failing/16 extract from subproject/test.json b/test cases/failing/16 extract from subproject/test.json
--- a/test cases/failing/16 extract from subproject/test.json	
+++ b/test cases/failing/16 extract from subproject/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/16 extract from subproject/meson.build:6:0: ERROR: Tried to extract objects from a different subproject."
+      "line": "test cases/failing/16 extract from subproject/meson.build:7:32: ERROR: Tried to extract objects from a different subproject."
     }
   ]
 }
diff --git a/test cases/failing/21 subver/test.json b/test cases/failing/21 subver/test.json
--- a/test cases/failing/21 subver/test.json	
+++ b/test cases/failing/21 subver/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/21 subver/meson.build:3:0: ERROR: Subproject foo version is 1.0.0 but ['>1.0.0'] required."
+      "line": "test cases/failing/21 subver/meson.build:3:4: ERROR: Subproject foo version is 1.0.0 but ['>1.0.0'] required."
     }
   ]
 }
diff --git a/test cases/failing/28 no crossprop/test.json b/test cases/failing/28 no crossprop/test.json
--- a/test cases/failing/28 no crossprop/test.json	
+++ b/test cases/failing/28 no crossprop/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/28 no crossprop/meson.build:3:0: ERROR: Unknown property for host machine: nonexisting"
+      "line": "test cases/failing/28 no crossprop/meson.build:3:14: ERROR: Unknown property for host machine: nonexisting"
     }
   ]
 }
diff --git a/test cases/failing/30 invalid man extension/test.json b/test cases/failing/30 invalid man extension/test.json
--- a/test cases/failing/30 invalid man extension/test.json	
+++ b/test cases/failing/30 invalid man extension/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/30 invalid man extension/meson.build:2:0: ERROR: Man file must have a file extension of a number between 1 and 9"
+      "line": "test cases/failing/30 invalid man extension/meson.build:2:5: ERROR: Man file must have a file extension of a number between 1 and 9"
     }
   ]
 }
diff --git a/test cases/failing/31 no man extension/test.json b/test cases/failing/31 no man extension/test.json
--- a/test cases/failing/31 no man extension/test.json	
+++ b/test cases/failing/31 no man extension/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/31 no man extension/meson.build:2:0: ERROR: Man file must have a file extension of a number between 1 and 9"
+      "line": "test cases/failing/31 no man extension/meson.build:2:5: ERROR: Man file must have a file extension of a number between 1 and 9"
     }
   ]
 }
diff --git a/test cases/failing/32 exe static shared/test.json b/test cases/failing/32 exe static shared/test.json
--- a/test cases/failing/32 exe static shared/test.json	
+++ b/test cases/failing/32 exe static shared/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/32 exe static shared/meson.build:9:0: ERROR: Can't link non-PIC static library 'stat' into shared library 'shr2'. Use the 'pic' option to static_library to build with PIC."
+      "line": "test cases/failing/32 exe static shared/meson.build:9:9: ERROR: Can't link non-PIC static library 'stat' into shared library 'shr2'. Use the 'pic' option to static_library to build with PIC."
     }
   ]
 }
diff --git a/test cases/failing/34 dependency not-required then required/test.json b/test cases/failing/34 dependency not-required then required/test.json
--- a/test cases/failing/34 dependency not-required then required/test.json	
+++ b/test cases/failing/34 dependency not-required then required/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "match": "re",
-      "line": ".*/meson\\.build:4:0: ERROR: (Pkg-config binary for machine MachineChoice\\.HOST not found\\. Giving up\\.|Dependency \"foo\\-bar\\-xyz\\-12\\.3\" not found, tried .*)"
+      "line": ".*/meson\\.build:4:10: ERROR: (Pkg-config binary for machine MachineChoice\\.HOST not found\\. Giving up\\.|Dependency \"foo\\-bar\\-xyz\\-12\\.3\" not found, tried .*)"
     }
   ]
 }
diff --git a/test cases/failing/39 kwarg assign/test.json b/test cases/failing/39 kwarg assign/test.json
--- a/test cases/failing/39 kwarg assign/test.json	
+++ b/test cases/failing/39 kwarg assign/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/39 kwarg assign/meson.build:3:0: ERROR: Tried to assign values inside an argument list."
+      "line": "test cases/failing/39 kwarg assign/meson.build:3:30: ERROR: Tried to assign values inside an argument list."
     }
   ]
 }
diff --git a/test cases/failing/49 executable comparison/test.json b/test cases/failing/49 executable comparison/test.json
--- a/test cases/failing/49 executable comparison/test.json	
+++ b/test cases/failing/49 executable comparison/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "match": "re",
-      "line": "test cases/failing/49 executable comparison/meson.build:6:0: ERROR: Object <ExecutableHolder prog1@exe: prog1(.exe)?> of type Executable does not support the `<` operator."
+      "line": "test cases/failing/49 executable comparison/meson.build:6:14: ERROR: Object <ExecutableHolder prog1@exe: prog1(.exe)?> of type Executable does not support the `<` operator."
     }
   ]
 }
diff --git a/test cases/failing/50 inconsistent comparison/test.json b/test cases/failing/50 inconsistent comparison/test.json
--- a/test cases/failing/50 inconsistent comparison/test.json	
+++ b/test cases/failing/50 inconsistent comparison/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/50 inconsistent comparison/meson.build:5:0: ERROR: Object <[ArrayHolder] holds [list]: []> of type array does not support the `<` operator."
+      "line": "test cases/failing/50 inconsistent comparison/meson.build:5:12: ERROR: Object <[ArrayHolder] holds [list]: []> of type array does not support the `<` operator."
     }
   ]
 }
diff --git a/test cases/failing/56 link with executable/test.json b/test cases/failing/56 link with executable/test.json
--- a/test cases/failing/56 link with executable/test.json	
+++ b/test cases/failing/56 link with executable/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/56 link with executable/meson.build:4:0: ERROR: Link target 'prog' is not linkable."
+      "line": "test cases/failing/56 link with executable/meson.build:4:4: ERROR: Link target 'prog' is not linkable."
     }
   ]
 }
diff --git a/test cases/failing/6 missing incdir/test.json b/test cases/failing/6 missing incdir/test.json
--- a/test cases/failing/6 missing incdir/test.json	
+++ b/test cases/failing/6 missing incdir/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/6 missing incdir/meson.build:3:0: ERROR: Include dir nosuchdir does not exist."
+      "line": "test cases/failing/6 missing incdir/meson.build:3:6: ERROR: Include dir nosuchdir does not exist."
     }
   ]
 }
diff --git a/test cases/failing/64 dependency not-found and required/test.json b/test cases/failing/64 dependency not-found and required/test.json
--- a/test cases/failing/64 dependency not-found and required/test.json	
+++ b/test cases/failing/64 dependency not-found and required/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/64 dependency not-found and required/meson.build:2:0: ERROR: Dependency is required but has no candidates."
+      "line": "test cases/failing/64 dependency not-found and required/meson.build:2:6: ERROR: Dependency is required but has no candidates."
     }
   ]
 }
diff --git a/test cases/failing/65 subproj different versions/test.json b/test cases/failing/65 subproj different versions/test.json
--- a/test cases/failing/65 subproj different versions/test.json	
+++ b/test cases/failing/65 subproj different versions/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/65 subproj different versions/subprojects/b/meson.build:3:0: ERROR: Dependency 'c' is required but not found."
+      "line": "test cases/failing/65 subproj different versions/subprojects/b/meson.build:3:8: ERROR: Dependency 'c' is required but not found."
     }
   ]
 }
diff --git a/test cases/failing/66 wrong boost module/test.json b/test cases/failing/66 wrong boost module/test.json
--- a/test cases/failing/66 wrong boost module/test.json	
+++ b/test cases/failing/66 wrong boost module/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/66 wrong boost module/meson.build:9:0: ERROR: Dependency \"boost\" not found, tried system"
+      "line": "test cases/failing/66 wrong boost module/meson.build:9:10: ERROR: Dependency \"boost\" not found, tried system"
     }
   ]
 }
diff --git a/test cases/failing/74 link with shared module on osx/test.json b/test cases/failing/74 link with shared module on osx/test.json
--- a/test cases/failing/74 link with shared module on osx/test.json	
+++ b/test cases/failing/74 link with shared module on osx/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/74 link with shared module on osx/meson.build:8:0: ERROR: target prog links against shared module mymodule. This is not permitted on OSX"
+      "line": "test cases/failing/74 link with shared module on osx/meson.build:8:4: ERROR: target prog links against shared module mymodule. This is not permitted on OSX"
     }
   ]
 }
diff --git a/test cases/failing/76 subproj dependency not-found and required/test.json b/test cases/failing/76 subproj dependency not-found and required/test.json
--- a/test cases/failing/76 subproj dependency not-found and required/test.json	
+++ b/test cases/failing/76 subproj dependency not-found and required/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/76 subproj dependency not-found and required/meson.build:2:0: ERROR: Neither a subproject directory nor a missing.wrap file was found."
+      "line": "test cases/failing/76 subproj dependency not-found and required/meson.build:2:10: ERROR: Neither a subproject directory nor a missing.wrap file was found."
     }
   ]
 }
diff --git a/test cases/failing/78 framework dependency with version/test.json b/test cases/failing/78 framework dependency with version/test.json
--- a/test cases/failing/78 framework dependency with version/test.json	
+++ b/test cases/failing/78 framework dependency with version/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/78 framework dependency with version/meson.build:8:0: ERROR: Dependency lookup for appleframeworks with method 'framework' failed: Unknown version, but need ['>0']."
+      "line": "test cases/failing/78 framework dependency with version/meson.build:8:6: ERROR: Dependency lookup for appleframeworks with method 'framework' failed: Unknown version, but need ['>0']."
     }
   ]
 }
diff --git a/test cases/failing/8 recursive/test.json b/test cases/failing/8 recursive/test.json
--- a/test cases/failing/8 recursive/test.json	
+++ b/test cases/failing/8 recursive/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/8 recursive/subprojects/b/meson.build:3:0: ERROR: Recursive include of subprojects: a => b => a."
+      "line": "test cases/failing/8 recursive/subprojects/b/meson.build:3:4: ERROR: Recursive include of subprojects: a => b => a."
     }
   ]
 }
diff --git a/test cases/failing/80 gl dependency with version/test.json b/test cases/failing/80 gl dependency with version/test.json
--- a/test cases/failing/80 gl dependency with version/test.json	
+++ b/test cases/failing/80 gl dependency with version/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/80 gl dependency with version/meson.build:9:0: ERROR: Dependency lookup for gl with method 'system' failed: Unknown version, but need ['>0']."
+      "line": "test cases/failing/80 gl dependency with version/meson.build:9:6: ERROR: Dependency lookup for gl with method 'system' failed: Unknown version, but need ['>0']."
     }
   ]
 }
diff --git a/test cases/failing/81 threads dependency with version/test.json b/test cases/failing/81 threads dependency with version/test.json
--- a/test cases/failing/81 threads dependency with version/test.json	
+++ b/test cases/failing/81 threads dependency with version/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/81 threads dependency with version/meson.build:3:0: ERROR: Dependency lookup for threads with method 'system' failed: Unknown version, but need ['>0']."
+      "line": "test cases/failing/81 threads dependency with version/meson.build:3:6: ERROR: Dependency lookup for threads with method 'system' failed: Unknown version, but need ['>0']."
     }
   ]
 }
diff --git a/test cases/failing/82 gtest dependency with version/test.json b/test cases/failing/82 gtest dependency with version/test.json
--- a/test cases/failing/82 gtest dependency with version/test.json	
+++ b/test cases/failing/82 gtest dependency with version/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/82 gtest dependency with version/meson.build:8:0: ERROR: Dependency 'gtest' is required but not found."
+      "line": "test cases/failing/82 gtest dependency with version/meson.build:8:6: ERROR: Dependency 'gtest' is required but not found."
     }
   ]
 }
diff --git a/test cases/failing/86 subproj not-found dep/test.json b/test cases/failing/86 subproj not-found dep/test.json
--- a/test cases/failing/86 subproj not-found dep/test.json	
+++ b/test cases/failing/86 subproj not-found dep/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/86 subproj not-found dep/meson.build:2:0: ERROR: Dependency '(anonymous)' is required but not found."
+      "line": "test cases/failing/86 subproj not-found dep/meson.build:2:10: ERROR: Dependency '(anonymous)' is required but not found."
     }
   ]
 }
diff --git a/test cases/failing/88 kwarg dupe/test.json b/test cases/failing/88 kwarg dupe/test.json
--- a/test cases/failing/88 kwarg dupe/test.json	
+++ b/test cases/failing/88 kwarg dupe/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/88 kwarg dupe/meson.build:5:0: ERROR: Entry \"install\" defined both as a keyword argument and in a \"kwarg\" entry."
+      "line": "test cases/failing/88 kwarg dupe/meson.build:6:2: ERROR: Entry \"install\" defined both as a keyword argument and in a \"kwarg\" entry."
     }
   ]
 }
diff --git a/test cases/failing/89 missing pch file/test.json b/test cases/failing/89 missing pch file/test.json
--- a/test cases/failing/89 missing pch file/test.json	
+++ b/test cases/failing/89 missing pch file/test.json	
@@ -2,7 +2,7 @@
   "stdout": [
     {
       "comment": "literal 'pch/prog.h' from meson.build appears in output, irrespective of os.path.sep",
-      "line": "test cases/failing/89 missing pch file/meson.build:2:0: ERROR: File pch/prog.h does not exist."
+      "line": "test cases/failing/89 missing pch file/meson.build:2:6: ERROR: File pch/prog.h does not exist."
     }
   ]
 }
diff --git a/test cases/failing/90 pch source different folder/test.json b/test cases/failing/90 pch source different folder/test.json
--- a/test cases/failing/90 pch source different folder/test.json	
+++ b/test cases/failing/90 pch source different folder/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/90 pch source different folder/meson.build:4:0: ERROR: PCH files must be stored in the same folder."
+      "line": "test cases/failing/90 pch source different folder/meson.build:4:6: ERROR: PCH files must be stored in the same folder."
     }
   ]
 }
diff --git a/test cases/failing/93 add dict non string key/test.json b/test cases/failing/93 add dict non string key/test.json
--- a/test cases/failing/93 add dict non string key/test.json	
+++ b/test cases/failing/93 add dict non string key/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/93 add dict non string key/meson.build:9:0: ERROR: Key must be a string"
+      "line": "test cases/failing/93 add dict non string key/meson.build:9:9: ERROR: Key must be a string"
     }
   ]
 }
diff --git a/test cases/failing/94 add dict duplicate keys/test.json b/test cases/failing/94 add dict duplicate keys/test.json
--- a/test cases/failing/94 add dict duplicate keys/test.json	
+++ b/test cases/failing/94 add dict duplicate keys/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/94 add dict duplicate keys/meson.build:9:0: ERROR: Duplicate dictionary key: myKey"
+      "line": "test cases/failing/94 add dict duplicate keys/meson.build:9:27: ERROR: Duplicate dictionary key: myKey"
     }
   ]
 }
diff --git a/test cases/failing/95 no host get_external_property/test.json b/test cases/failing/95 no host get_external_property/test.json
--- a/test cases/failing/95 no host get_external_property/test.json	
+++ b/test cases/failing/95 no host get_external_property/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/failing/95 no host get_external_property/meson.build:3:0: ERROR: Unknown property for host machine: nonexisting"
+      "line": "test cases/failing/95 no host get_external_property/meson.build:3:14: ERROR: Unknown property for host machine: nonexisting"
     }
   ]
 }
diff --git a/test cases/rust/12 bindgen/test.json b/test cases/rust/12 bindgen/test.json
--- a/test cases/rust/12 bindgen/test.json	
+++ b/test cases/rust/12 bindgen/test.json	
@@ -1,7 +1,7 @@
 {
   "stdout": [
     {
-      "line": "test cases/rust/12 bindgen/meson.build:30: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]."
+      "line": "test cases/rust/12 bindgen/meson.build:27: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]."
     }
   ]
 }