daily update on 20250220 by nitload youmu, building AST generator, correct type naming
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -39,6 +40,23 @@ namespace StgSharp.Script.Express
|
||||
public static partial class ExpCompile
|
||||
{
|
||||
|
||||
private static void PoolKeywords()
|
||||
{
|
||||
FieldInfo[] fields = typeof( KeyWord ).GetFields(
|
||||
BindingFlags.Public );
|
||||
ParallelLoopResult result = Parallel.ForEach(
|
||||
fields, static( field ) => {
|
||||
if( field.FieldType == typeof( string ) ) {
|
||||
string? str =
|
||||
field.GetValue( null ) as string;
|
||||
if( str != null ) {
|
||||
_compileStringCache.GetOrAdd( str );
|
||||
}
|
||||
}
|
||||
} );
|
||||
while( !result.IsCompleted ) { }
|
||||
}
|
||||
|
||||
public static class KeyWord
|
||||
{
|
||||
|
||||
@@ -56,6 +74,7 @@ namespace StgSharp.Script.Express
|
||||
SUB = "SUB",
|
||||
MUL = "MUL",
|
||||
DIV = "DIV",
|
||||
NOT = "NOT",
|
||||
Assignment = ":=",
|
||||
Equal = "=",
|
||||
Mod = "MOD",
|
||||
@@ -66,9 +85,9 @@ namespace StgSharp.Script.Express
|
||||
Insert = "INSERT",
|
||||
Remove = "REMOVE",
|
||||
ANDOR = "ANDOR",
|
||||
GetIndex = "[]",
|
||||
UnaryAdd = "unary+",
|
||||
UnarySub = "unary-",
|
||||
GetIndex = "[",
|
||||
UnaryAdd = "+",
|
||||
UnarySub = "-",
|
||||
Exp = "**";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user