SpecParsingError: only print context if available
Signed-off-by: Gregory Becker <becker33@llnl.gov>
This commit is contained in:
parent
e66ae3959d
commit
ce3fcf011f
@ -578,6 +578,7 @@ class SpecParsingError(spack.error.SpecSyntaxError):
|
||||
|
||||
def __init__(self, message, token, text):
|
||||
message += f"\n{text}"
|
||||
if token:
|
||||
underline = f"\n{' '*token.start}{'^'*(token.end - token.start)}"
|
||||
message += color.colorize(f"@*r{{{underline}}}")
|
||||
super().__init__(message)
|
||||
|
Loading…
Reference in New Issue
Block a user