diff --git a/Content.Tests/DMProject/Tests/Preprocessor/number_in_arg.dm b/Content.Tests/DMProject/Tests/Preprocessor/number_in_arg.dm new file mode 100644 index 0000000000..a353f04cfc --- /dev/null +++ b/Content.Tests/DMProject/Tests/Preprocessor/number_in_arg.dm @@ -0,0 +1,4 @@ +#define MACRO(ARG_1, ARG_2) "[#ARG_1] [##ARG_2]" + +/proc/RunTest() + ASSERT(MACRO(1, 2) == "1 2") \ No newline at end of file diff --git a/DMCompiler/Compiler/DMPreprocessor/DMPreprocessorLexer.cs b/DMCompiler/Compiler/DMPreprocessor/DMPreprocessorLexer.cs index 659cc3c03b..3d02133665 100644 --- a/DMCompiler/Compiler/DMPreprocessor/DMPreprocessorLexer.cs +++ b/DMCompiler/Compiler/DMPreprocessor/DMPreprocessorLexer.cs @@ -442,7 +442,7 @@ public Token NextToken(bool ignoreWhitespace = false) { } TokenTextBuilder.Clear(); - while (char.IsAsciiLetter(GetCurrent()) || GetCurrent() == '_') { + while (char.IsAsciiLetterOrDigit(GetCurrent()) || GetCurrent() == '_') { TokenTextBuilder.Append(GetCurrent()); Advance(); }