From 346b5c4be71bb1f502507d92ffdb1ded4c3bd85d Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Fri, 14 Feb 2020 02:58:37 +0000 Subject: Store filename in node location Warnings have a location node object (with subdir and lineno attributes), which is passed as a location: kwarg to mlog.warning() and formatted in _log_error(). Re-purpose the subdir attribute (path relative to the source root dir, with an implied filename of 'meson.build'), which is stored into the node by parser(), to contain a pathname. (Properly I should rename 'subdir' -> 'file' everywhere, but that's a lot of churn just to see if this works) Notes: The warning location node may also have a colno attribute, which is currently ignored by _log_error(). We can't currently issue warnings with locations in meson_options.txt because the filename isn't part of the location (as it's assumed to be 'meson.build). --- mesonbuild/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mesonbuild/interpreter.py') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index bd85577..a9e0a3b 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -3748,7 +3748,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self code = f.read() assert(isinstance(code, str)) try: - codeblock = mparser.Parser(code, self.subdir).parse() + codeblock = mparser.Parser(code, absname).parse() except mesonlib.MesonException as me: me.file = absname raise me -- cgit v1.1