daily update on 20250210 by nitload youmu
This commit is contained in:
@@ -41,13 +41,12 @@ namespace StgSharp.Script.Express
|
||||
{
|
||||
public static partial class ExpCompile
|
||||
{
|
||||
|
||||
private static ConcurrentStringHashMultiplexer _multiplexer;
|
||||
private static Dictionary<string, ExpElementInstanceBase> _builtinConst;
|
||||
private static Dictionary<string, ExpTypeSource> _builtinType;
|
||||
private static StringPool _compileStringCache;
|
||||
|
||||
|
||||
|
||||
public static Dictionary<string, ExpElementInstanceBase> BuiltinConst => _builtinConst;
|
||||
|
||||
internal static ConcurrentStringHashMultiplexer Multiplexer
|
||||
@@ -71,9 +70,13 @@ namespace StgSharp.Script.Express
|
||||
_compileStringCache.Reset();
|
||||
}
|
||||
|
||||
public static void SkipComment(IScriptSourceProvider source)
|
||||
public static void DeinitCompile()
|
||||
{
|
||||
_compileStringCache.Reset();
|
||||
_compileStringCache = null;
|
||||
|
||||
_multiplexer.Dispose();
|
||||
_multiplexer = null;
|
||||
}
|
||||
|
||||
public static void InitCompile()
|
||||
@@ -83,17 +86,27 @@ namespace StgSharp.Script.Express
|
||||
|
||||
_builtinType = new Dictionary<string, ExpTypeSource>( _multiplexer ) {
|
||||
{ AddOrGetString( KeyWord.Int ), new ExpBuiltinType(
|
||||
AddOrGetString( KeyWord.Int ),typeof( int ) ) },
|
||||
{ AddOrGetString( KeyWord.Real ), new ExpBuiltinType(
|
||||
AddOrGetString( KeyWord.Real ), typeof( float ) ) },
|
||||
{ AddOrGetString(KeyWord.Bool ), new ExpBuiltinType(
|
||||
AddOrGetString(KeyWord.Bool ), typeof( bool ) ) },
|
||||
{ AddOrGetString(KeyWord.Binary ), new ExpBuiltinType(
|
||||
AddOrGetString(KeyWord.Binary ),typeof( bool ) ) },
|
||||
{ AddOrGetString(KeyWord.String ), new ExpBuiltinType(
|
||||
AddOrGetString(KeyWord.String ),typeof( string ) ) },
|
||||
{ AddOrGetString(KeyWord.Logic ), new ExpBuiltinType(
|
||||
AddOrGetString(KeyWord.Logic ), typeof( Logic ) ) } };
|
||||
AddOrGetString( KeyWord.Int ),
|
||||
typeof( int ) ) }, { AddOrGetString( KeyWord.Real ), new ExpBuiltinType(
|
||||
AddOrGetString( KeyWord.Real ),
|
||||
typeof( float ) ) }, { AddOrGetString(
|
||||
KeyWord.Bool ), new ExpBuiltinType(
|
||||
AddOrGetString(
|
||||
KeyWord.Bool ),
|
||||
typeof( bool ) ) }, { AddOrGetString(
|
||||
KeyWord.Binary ), new ExpBuiltinType(
|
||||
AddOrGetString(
|
||||
KeyWord.Binary ),
|
||||
typeof( bool ) ) }, { AddOrGetString(
|
||||
KeyWord.String ), new ExpBuiltinType(
|
||||
AddOrGetString(
|
||||
KeyWord.String ),
|
||||
typeof( string ) ) }, { AddOrGetString(
|
||||
KeyWord.Logic ), new ExpBuiltinType(
|
||||
AddOrGetString(
|
||||
KeyWord.Logic ),
|
||||
typeof( ExpLogic ) ) }
|
||||
};
|
||||
|
||||
_builtinConst = new Dictionary<string, ExpElementInstanceBase>(
|
||||
_multiplexer ) {
|
||||
@@ -104,14 +117,7 @@ namespace StgSharp.Script.Express
|
||||
};
|
||||
}
|
||||
|
||||
public static void DeinitCompile()
|
||||
{
|
||||
_compileStringCache.Reset();
|
||||
_compileStringCache = null;
|
||||
|
||||
_multiplexer.Dispose();
|
||||
_multiplexer = null;
|
||||
}
|
||||
public static void SkipComment( IScriptSourceProvider source ) { }
|
||||
|
||||
public static bool TryGetBuiltinConst(
|
||||
string constName,
|
||||
|
||||
Reference in New Issue
Block a user