aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mparser.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-12-14 15:03:20 -0800
committerEli Schwartz <eschwartz93@gmail.com>2023-01-03 14:49:02 -0500
commit7460ab20cd42d79a3394a81f103228b1337aff34 (patch)
treef7766f176a148174c62e1a4af55a4831267627d1 /mesonbuild/mparser.py
parentb9ef66292602349c7a48d8779355bdc87cfc06fa (diff)
downloadmeson-7460ab20cd42d79a3394a81f103228b1337aff34.zip
meson-7460ab20cd42d79a3394a81f103228b1337aff34.tar.gz
meson-7460ab20cd42d79a3394a81f103228b1337aff34.tar.bz2
mlog: move code for printing code with a caret to the mlog module
We need this outside the constructor for the ParseException class, so let's pull it out. mlog seemed like a good place since it's a text formatting function, and has no dependencies.
Diffstat (limited to 'mesonbuild/mparser.py')
-rw-r--r--mesonbuild/mparser.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py
index 6b49365..98f530f 100644
--- a/mesonbuild/mparser.py
+++ b/mesonbuild/mparser.py
@@ -47,7 +47,7 @@ def decode_match(match: T.Match[str]) -> str:
class ParseException(MesonException):
def __init__(self, text: str, line: str, lineno: int, colno: int) -> None:
# Format as error message, followed by the line with the error, followed by a caret to show the error column.
- super().__init__("{}\n{}\n{}".format(text, line, '{}^'.format(' ' * colno)))
+ super().__init__(mlog.code_line(text, line, colno))
self.lineno = lineno
self.colno = colno