Support adding filename to diagnostic.
This commit is contained in:
@@ -272,7 +272,7 @@ namespace ElohimScript::Parser {
|
||||
default:
|
||||
if (IsAlphaNumericalOrUnderscore(c))
|
||||
return LexKeywordOrIdentifier();
|
||||
_diagnostics->LogError(Diagnostics::DiagnosticType::UnknownToken, TextSpan(start, start + 1));
|
||||
LogError(Diagnostics::DiagnosticType::UnknownToken, TextSpan(start, start + 1));
|
||||
return Create<LexTokenImpl<LexTokenKind::Unknown>>(TextSpan(start, start + 1));
|
||||
}
|
||||
}
|
||||
@@ -295,8 +295,8 @@ namespace ElohimScript::Parser {
|
||||
case 'b':
|
||||
case 'B': numericalSystem = 2; break;
|
||||
default:
|
||||
_diagnostics->LogError(Diagnostics::DiagnosticType::InvalidNumericalBase,
|
||||
TextSpan(_position - 1, _position + 1));
|
||||
LogError(Diagnostics::DiagnosticType::InvalidNumericalBase,
|
||||
TextSpan(_position - 1, _position + 1));
|
||||
// Set to the largest numerical system, so we can prevent errors down the line.
|
||||
numericalSystem = 16;
|
||||
break;
|
||||
@@ -442,13 +442,11 @@ namespace ElohimScript::Parser {
|
||||
break;
|
||||
}
|
||||
if (current == u8'\0') {
|
||||
_diagnostics->LogError(Diagnostics::DiagnosticType::ExpectedEndOfString,
|
||||
TextSpan(start, start + offset));
|
||||
LogError(Diagnostics::DiagnosticType::ExpectedEndOfString, TextSpan(start, start + offset));
|
||||
break;
|
||||
}
|
||||
if (!heredoc && (current == u8'\n' || current == u8'\r')) {
|
||||
_diagnostics->LogError(Diagnostics::DiagnosticType::ExpectedEndOfString,
|
||||
TextSpan(start, start + offset));
|
||||
LogError(Diagnostics::DiagnosticType::ExpectedEndOfString, TextSpan(start, start + offset));
|
||||
break;
|
||||
}
|
||||
offset++;
|
||||
|
||||
Reference in New Issue
Block a user