Skip to content

Commit

Permalink
Fix github bot issues
Browse files Browse the repository at this point in the history
Not even mine in the preproc...
  • Loading branch information
SaphireLattice committed Nov 16, 2024
1 parent df3b514 commit cec85d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions DMCompiler/Compiler/DM/DMLexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected override Token ParseNextToken() {
token = preprocToken;
}
} else {
var FirstTokenLocation = CurrentLocation;
var firstTokenLocation = CurrentLocation;
switch (preprocToken.Type) {
case TokenType.DM_Preproc_Whitespace: Advance(); token = CreateToken(TokenType.DM_Whitespace, preprocToken.Text); break;
case TokenType.DM_Preproc_Punctuator_LeftParenthesis: BracketNesting++; Advance(); token = CreateToken(TokenType.DM_LeftParenthesis, preprocToken.Text); break;
Expand All @@ -127,17 +127,17 @@ protected override Token ParseNextToken() {
switch (Advance().Type) {
case TokenType.DM_Preproc_Punctuator_Period:
Advance();
token = CreateToken(TokenType.DM_QuestionPeriod, "?.", FirstTokenLocation);
token = CreateToken(TokenType.DM_QuestionPeriod, "?.", firstTokenLocation);
break;

case TokenType.DM_Preproc_Punctuator_Colon:
Advance();
token = CreateToken(TokenType.DM_QuestionColon, "?:", FirstTokenLocation);
token = CreateToken(TokenType.DM_QuestionColon, "?:", firstTokenLocation);
break;

case TokenType.DM_Preproc_Punctuator_LeftBracket:
Advance();
token = CreateToken(TokenType.DM_QuestionLeftBracket, "?[", FirstTokenLocation);
token = CreateToken(TokenType.DM_QuestionLeftBracket, "?[", firstTokenLocation);
BracketNesting++;
break;

Expand All @@ -151,9 +151,9 @@ protected override Token ParseNextToken() {
case TokenType.DM_Preproc_Punctuator_Period:
if (Advance().Type == TokenType.DM_Preproc_Punctuator_Period) {
Advance();
token = CreateToken(TokenType.DM_IndeterminateArgs, "...", FirstTokenLocation);
token = CreateToken(TokenType.DM_IndeterminateArgs, "...", firstTokenLocation);
} else {
token = CreateToken(TokenType.DM_SuperProc, "..", FirstTokenLocation);
token = CreateToken(TokenType.DM_SuperProc, "..", firstTokenLocation);
}

break;
Expand Down Expand Up @@ -266,7 +266,7 @@ protected override Token ParseNextToken() {
var identifierText = TokenTextBuilder.ToString();
var tokenType = Keywords.GetValueOrDefault(identifierText, TokenType.DM_Identifier);

token = CreateToken(tokenType, identifierText, FirstTokenLocation);
token = CreateToken(tokenType, identifierText, firstTokenLocation);
break;
}
case TokenType.DM_Preproc_Number: {
Expand Down
4 changes: 2 additions & 2 deletions DMCompiler/Compiler/DMPreprocessor/DMPreprocessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ private void HandlePragmaDirective() {

Token warningTypeToken = GetNextToken(true);
if (warningTypeToken.Type != TokenType.DM_Preproc_Identifier) {
compiler.Emit(WarningCode.BadDirective, warningTypeToken.Location, $"Warnings can only be set to disabled, notice, warning, or error");
compiler.Emit(WarningCode.BadDirective, warningTypeToken.Location, "Warnings can only be set to disabled, notice, warning, or error");
return;
}
switch(warningTypeToken.Text.ToLower()) {
Expand All @@ -660,7 +660,7 @@ private void HandlePragmaDirective() {
compiler.SetPragma(warningCode, ErrorLevel.Error);
break;
default:
compiler.Emit(WarningCode.BadDirective, warningTypeToken.Location, $"Warnings can only be set to disabled, notice, warning, or error");
compiler.Emit(WarningCode.BadDirective, warningTypeToken.Location, "Warnings can only be set to disabled, notice, warning, or error");
return;
}
}
Expand Down

0 comments on commit cec85d2

Please sign in to comment.