define cosntants for csharp parse options.

This commit is contained in:
zhurengong
2022-04-25 21:15:30 +08:00
parent 3aec67aa8e
commit 8a34ead2ef
3 changed files with 13 additions and 2 deletions
@@ -55,7 +55,7 @@ namespace Barotrauma
try
{
code = ToOneTimeScript(code);
var syntaxTree = SyntaxFactory.ParseSyntaxTree(code, CSharpParseOptions.Default);
var syntaxTree = SyntaxFactory.ParseSyntaxTree(code, CSharpParseOptions.Default.WithPreprocessorSymbols(PreprocessingSymbols));
var compilation = CSharpCompilation.Create(NET_ONE_TIME_SCRIPT_ASSEMBLY, new[] { AssemblyInfoSyntaxTree(NET_ONE_TIME_SCRIPT_ASSEMBLY), syntaxTree }, defaultReferences, compileOptions);
Assembly assembly = null;