Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit c33d128

Browse files
committed
Fix #32
Now the tokens after a preprocessor directive (until EOL) are ignored
1 parent 853b5de commit c33d128

File tree

1 file changed

+7
-1
lines changed
  • SourcepawnCondenser/SourcepawnCondenser/Tokenizer

1 file changed

+7
-1
lines changed

SourcepawnCondenser/SourcepawnCondenser/Tokenizer/Tokenizer.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,10 +393,16 @@ public static List<Token> TokenizeString(string Source, bool IgnoreMultipleEOL)
393393

394394
var directiveString = Source.Substring(startIndex, endIndex - startIndex);
395395
token.Add(new Token(directiveString, TokenKind.PrePocessorDirective, startIndex));
396-
i = endIndex - 1;
396+
for (var j = i + 1; j < sArrayLength; ++j)
397+
if (sArray[j] == '\n' || sArray[j] == '\r')
398+
{
399+
i = j-1;
400+
break;
401+
}
397402
continue;
398403
}
399404
}
405+
400406
}
401407

402408
#endregion

0 commit comments

Comments
 (0)