diff --git a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs index a8930022..c8978676 100644 --- a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs +++ b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9647c2c68a768a1d0a5a05cc1279d046403c4641")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6222f8c8be57d511d2ec40523717e20b87fcff9d")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Common")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json index fdd23080..bbe5bf39 100644 --- a/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json +++ b/StgSharp.Common/obj/x64/Debug/net8.0/StgSharp.Common.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/9647c2c68a768a1d0a5a05cc1279d046403c4641/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/6222f8c8be57d511d2ec40523717e20b87fcff9d/*"}} \ No newline at end of file diff --git a/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs b/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs index 199fbf42..c09aa765 100644 --- a/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs +++ b/StgSharp.Script/Express/CompileEnv/DefaultSchema.cs @@ -103,17 +103,17 @@ namespace StgSharp.Script.Express { IEnumerable> builtinTypeSource = [ new KeyValuePair( - PoolString( KeyWord.Int ), - new ExpBuiltinType( KeyWord.Int, typeof( int ) ) ), + PoolString( KeyWord.Integer ), + new ExpBuiltinType( KeyWord.Integer, typeof( int ) ) ), new KeyValuePair( PoolString( KeyWord.Real ), new ExpBuiltinType( KeyWord.Real, typeof( float ) ) ), new KeyValuePair( - PoolString( KeyWord.Bool ), - new ExpBuiltinType( KeyWord.Bool, typeof( bool ) ) ), + PoolString( KeyWord.Boolean ), + new ExpBuiltinType( KeyWord.Boolean, typeof( bool ) ) ), new KeyValuePair( - PoolString( KeyWord.Logic ), - new ExpBuiltinType( KeyWord.Logic, typeof( ExpLogic ) ) ), + PoolString( KeyWord.Logical ), + new ExpBuiltinType( KeyWord.Logical, typeof( ExpLogic ) ) ), new KeyValuePair( PoolString( KeyWord.String ), new ExpBuiltinType( KeyWord.String, typeof( string ) ) ), diff --git a/StgSharp.Script/Express/CompileEnv/ExpCompile.cs b/StgSharp.Script/Express/CompileEnv/ExpCompile.cs index 31d59238..cb491d2f 100644 --- a/StgSharp.Script/Express/CompileEnv/ExpCompile.cs +++ b/StgSharp.Script/Express/CompileEnv/ExpCompile.cs @@ -50,7 +50,7 @@ namespace StgSharp.Script.Express private static FrozenDictionary _builtinConst; private static FrozenDictionary _builtinType; private static FrozenDictionary _operators; - private static StringPool _compileStringCache; + private static StringPool _compileStringCache,_emptyCache; internal static ConcurrentStringHashMultiplexer Multiplexer { @@ -88,20 +88,21 @@ namespace StgSharp.Script.Express InitPrecedence(); _operatorsWithLetter = [ - KeyWord.ADD, - KeyWord.SUB, - KeyWord.MUL, - KeyWord.DIV, - KeyWord.AND, - KeyWord.OR, - KeyWord.XOR, - KeyWord.ANDOR, - KeyWord.NOT, + KeyWord.Add, + KeyWord.Sub, + KeyWord.Mul, + KeyWord.Div, + KeyWord.And, + KeyWord.Or, + KeyWord.Xor, + KeyWord.AndOr, + KeyWord.Not, ]; ExpSchema_Nitload.Only .TryGetType( - PoolString( KeyWord.Int ), out ExpTypeSource? _expInt ); + PoolString( KeyWord.Integer ), + out ExpTypeSource? _expInt ); ExpInt = _expInt; ExpSchema_Nitload.Only @@ -111,9 +112,24 @@ namespace StgSharp.Script.Express ExpReal = _expReal; ExpSchema_Nitload.Only .TryGetType( - PoolString( KeyWord.Bool ), + PoolString( KeyWord.Boolean ), out ExpTypeSource? _expBool ); ExpBool = _expBool; + + _emptyCache = new StringPool(); + /* + foreach( string str in _compileStringCache ) { + _emptyCache.Add( str ); + } + /**/ + } + + public static bool LetterIsKeyword( string str ) + { + if( char.IsLetter( str[ 0 ] ) ) { + return _keywordSet.Contains( str ); + } + return true; } public static bool LetterIsOperator( string str ) diff --git a/StgSharp.Script/Express/CompileEnv/KeyWord.cs b/StgSharp.Script/Express/CompileEnv/KeyWord.cs index 684f7444..36a52973 100644 --- a/StgSharp.Script/Express/CompileEnv/KeyWord.cs +++ b/StgSharp.Script/Express/CompileEnv/KeyWord.cs @@ -40,8 +40,12 @@ namespace StgSharp.Script.Express public static partial class ExpCompile { + private static HashSet _keywordSet; + private static void PoolKeywords() { + _keywordSet = new(); + FieldInfo[] fields = typeof( KeyWord ).GetFields( BindingFlags.Public ); ParallelLoopResult result = Parallel.ForEach( @@ -49,6 +53,7 @@ namespace StgSharp.Script.Express if( field.FieldType == typeof( string ) && field.GetValue( null ) is string str ) { _compileStringCache.GetOrAdd( str ); + _keywordSet.Add( str ); } } ); while( !result.IsCompleted ) { } @@ -57,36 +62,294 @@ namespace StgSharp.Script.Express public static class KeyWord { - public const string Int = "INTAGER", - Real = "REAL", - Bool = "BOOLEAN", - String = "STRING", - Logic = "LOGIC", - Binary = "BINARY", - Constant = "CONSTANT", - AND = "AND", - OR = "OR", - XOR = "XOR", - ADD = "+", - SUB = "-", - MUL = "*", - DIV = "/", - NOT = "NOT", - NotEqual = "<>", - Assignment = ":=", - Equal = "=", - Mod = "MOD", - Self = "SELF", - Pi = "PI", - True = "TRUE", - False = "FALSE", - Insert = "INSERT", - Remove = "REMOVE", - ANDOR = "ANDOR", - GetIndex = "[", - UnaryPlus = "+", - UnaryMinus = "-", - Exp = "**"; + public static readonly HashSet ScopeBlock = new HashSet { + EndAlias, EndCase, EndConstant, EndEntity, EndFunction, EndIf, EndLocal, EndProcedure, EndRepeat, EndRule, EndSchema, EndSubtypeConstraint, EndType + }; + + public static readonly HashSet Symbols = [ + Dot, Comma, Semicolon, Colon, Percent, Apostrophe, + Backslash, IndexOf, RightBracket, LeftBrace, + RightBrace, Pipe, LeftParen, RightParen, LeftAsterisk, + Assignment, DoublePipe, ExpSymbole, CommentSingleLine, + CommentStart, CommentEnd, ColonEqualColon, ColonNotEqualColon + ]; + + #region Basic Data Type + + public const string Array = "ARRAY"; + public const string Bag = "BAG"; + public const string Binary = "BINARY"; + public const string Boolean = "BOOLEAN"; + public const string Enumeration = "ENUMERATION"; + public const string Integer = "INTEGER"; + public const string List = "LIST"; + public const string Logical = "LOGICAL"; + public const string Number = "NUMBER"; + public const string Of = "OF"; + public const string Real = "REAL"; + public const string Set = "SET"; + public const string String = "STRING"; + + #endregion + + #region Flow Control + + public const string Begin = "BEGIN"; + public const string Case = "CASE"; + public const string Else = "ELSE"; + public const string End = "END"; + public const string For = "FOR"; + public const string If = "IF"; + public const string Otherwise = "OTHERWISE"; + public const string Repeat = "REPEAT"; + public const string Return = "RETURN"; + public const string Skip = "SKIP"; + public const string Then = "THEN"; + public const string To = "TO"; + public const string Until = "UNTIL"; + public const string While = "WHILE"; + + #endregion + + #region Declarations + + public const string Constant = "CONSTANT"; + public const string Derive = "DERIVE"; + public const string Entity = "ENTITY"; + public const string Extensible = "EXTENSIBLE"; + public const string Fixed = "FIXED"; + public const string Function = "FUNCTION"; + public const string Generic = "GENERIC"; + public const string GenericEntity = "GENERIC_ENTITY"; + public const string Inverse = "INVERSE"; + public const string Local = "LOCAL"; + public const string Procedure = "PROCEDURE"; + public const string Rule = "RULE"; + public const string Schema = "SCHEMA"; + public const string Type = "TYPE"; + public const string Var = "VAR"; + + #endregion + + #region Constraints Inheritance + + public const string Oneof = "ONEOF"; + public const string Optional = "OPTIONAL"; + public const string Subtype = "SUBTYPE"; + public const string SubtypeConstraint = "SUBTYPE CONSTRAINT"; + public const string Supertype = "SUPERTYPE"; + public const string TotalOver = "TOTAL OVER"; + public const string Unique = "UNIQUE"; + public const string Where = "WHERE"; + + #endregion + + #region Scope + + public const string EndAlias = "END_ALIAS"; + public const string EndCase = "END_CASE"; + public const string EndConstant = "END_CONSTANT"; + public const string EndEntity = "END_ENTITY"; + public const string EndFunction = "END_FUNCTION"; + public const string EndIf = "END_IF"; + public const string EndLocal = "END_LOCAL"; + public const string EndProcedure = "END_PROCEDURE"; + public const string EndRepeat = "END_REPEAT"; + public const string EndRule = "END_RULE"; + public const string EndSchema = "END_SCHEMA"; + public const string EndSubtypeConstraint = "END_SUBTYPE CONSTRAINT"; + public const string EndType = "END_TYPE"; + + #endregion + + #region Index and Ref + + public const string Query = "QUERY"; + public const string Reference = "REFERENCE"; + public const string Select = "SELECT"; + + #endregion + + #region Modifiers Attributes + + public const string Abstract = "ABSTRACT"; + public const string Aggregate = "AGGREGATE"; + public const string As = "AS"; + public const string BasedOn = "BASED ON"; + public const string By = "BY"; + public const string Escape = "ESCAPE"; + public const string From = "FROM"; + public const string Use = "USE"; + public const string With = "WITH"; + + #endregion + + #region Aliasing + + public const string Alias = "ALIAS"; + public const string Renamed = "RENAMED"; + + #endregion + + + #region Operator + + public const string And = "AND"; + public const string AndOr = "ANDOR"; + public const string Div = "DIV"; + public const string In = "IN"; + public const string Like = "LIKE"; + public const string Mod = "MOD"; + public const string Not = "NOT"; + public const string Or = "OR"; + public const string Xor = "XOR"; + + #endregion + + #region Constants + + public const string QuestionMark = "?"; + public const string Self = "SELF"; + public const string Const = "CONST"; + public const string E = "E"; + public const string Pi = "PI"; + public const string False = "FALSE"; + public const string True = "TRUE"; + public const string Unknown = "UNKNOWN"; + + #endregion + + #region Functions + + public const string Abs = "ABS"; + public const string Acos = "ACOS"; + public const string Asin = "ASIN"; + public const string Atan = "ATAN"; + public const string Blength = "BLENGTH"; + public const string Cos = "COS"; + public const string Exists = "EXISTS"; + public const string Exp = "EXP"; + public const string Format = "FORMAT"; + public const string Hibound = "HIBOUND"; + public const string Hiindex = "HIINDEX"; + public const string Length = "LENGTH"; + public const string Lobound = "LObound"; + public const string Log = "LOG"; + public const string Log2 = "LOG2"; + public const string Log10 = "LOG10"; + public const string Loindex = "LOINDEX"; + public const string Nvl = "NVL"; + public const string Odd = "ODD"; + public const string Rolesof = "ROLESOF"; + public const string Sin = "SIN"; + public const string Sizeof = "SIZEOF"; + public const string Sqrt = "SQRT"; + public const string Tan = "TAN"; + public const string Typeof = "TYPEOF"; + public const string Usedin = "USEDIN"; + public const string Value = "VALUE"; + public const string ValueIn = "VALUE IN"; + public const string ValueUnique = "VALUE UNIQUE"; + + #endregion + + #region Procedure + + public const string Insert = "INSERT"; + public const string Remove = "REMOVE"; + + #endregion + + #region Symbols + + public const string Dot = "."; + public const string Comma = ","; + public const string Semicolon = ";"; + public const string Colon = ":"; + public const string Mul = "*"; + public const string Add = "+"; + public const string UnaryPlus = "+"; + public const string Sub = "-"; + public const string UnaryMinus = "-"; + public const string Equal = "="; + public const string Percent = "%"; + public const string Apostrophe = "'"; + public const string Backslash = "\\"; + public const string Slash = "/"; + public const string LessThan = "<"; + public const string GreaterThan = ">"; + public const string IndexOf = "["; + public const string RightBracket = "]"; + public const string LeftBrace = "{"; + public const string RightBrace = "}"; + public const string Pipe = "|"; + public const string EConstant = "E"; + public const string LeftParen = "("; + public const string RightParen = ")"; + public const string LessThanOrEqual = "<="; + public const string NotEqual = "<>"; + public const string GreaterThanOrEqual = ">="; + public const string LeftAsterisk = "<*"; + public const string Assignment = ":="; + public const string DoublePipe = "||"; + public const string ExpSymbole = "**"; + public const string CommentSingleLine = "--"; + public const string CommentStart = "(*"; + public const string CommentEnd = "*)"; + public const string ColonEqualColon = ":=:"; + public const string ColonNotEqualColon = ":<>:"; + + #endregion + + public static readonly HashSet DataTypes = [ + Array, Bag, Binary, Boolean, Enumeration, Integer, List, Logical, Number, Of, Real, Set, String + ]; + + public static readonly HashSet FlowControl = [ + Begin, Case, Else, End, For, If, Otherwise, Repeat, Return, Skip, Then, To, Until, While + ]; + + public static readonly HashSet Declarations = [ + Constant, Derive, Entity, Extensible, Fixed, Function, Generic, + GenericEntity, Inverse, Local, Procedure, Rule, Schema, Type, Var + ]; + + public static readonly HashSet ConstraintsInheritance = [ + Oneof, Optional, Subtype, SubtypeConstraint, Supertype, TotalOver, Unique, Where + ]; + + public static readonly HashSet QueryReference = [ + Query, Reference, Select + ]; + + public static readonly HashSet ModifiersAttributes = [ + Abstract, Aggregate, As, BasedOn, By, Escape, Fixed, From, Use, With + ]; + + public static readonly HashSet Aliasing = [ + Alias, Renamed + ]; + public static readonly HashSet Operators = [ + And, AndOr, Div, In, Like, Mod, Not, Or, Xor, + Add, Sub, Mul, Slash, Equal, NotEqual, + LessThan, GreaterThan, LessThanOrEqual, GreaterThanOrEqual + ]; + + public static readonly HashSet Literals = [ + QuestionMark, Self, Const, E, Pi, False, True, Unknown + ]; + + public static readonly HashSet InternalFunctions = [ + Abs, Acos, Asin, Atan, Blength, Cos, Exists, Exp, + Format, Hibound, Hiindex, Length, Lobound, Log, + Log2, Log10, Loindex, Nvl, Odd, Rolesof, Sin, + Sizeof, Sqrt, Tan, Typeof, Usedin, Value, + ValueIn, ValueUnique + ]; + + public static readonly HashSet InternalProcess = [ + Insert, Remove + ]; } diff --git a/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs new file mode 100644 index 00000000..e89752da --- /dev/null +++ b/StgSharp.Script/Express/ExpAstNode/ExpCollectionIndexNode.cs @@ -0,0 +1,77 @@ +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// file="ExpCollectionIndexNode.cs" +// Project: StgSharp +// AuthorGroup: Nitload Space +// Copyright (c) Nitload Space. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the “Software”), to deal in the Software without restriction, +// including without limitation the rights to use, copy, modify, merge, +// publish, distribute, sublicense, and/or sell copies of the Software, +// and to permit persons to whom the Software is furnished to do so, +// subject to the following conditions: +// +// The above copyright notice and +// this permission notice shall be included in all copies +// or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED “AS IS”, +// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +// ARISING FROM, OUT OF OR IN CONNECTION WITH +// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace StgSharp.Script.Express +{ + public class ExpCollectionIndexNode : ExpNode + { + + private ExpCollectionInstanceBase _collection; + + private ExpNode _indexExpression; + + private ExpCollectionIndexNode( + Token source, + ExpCollectionInstanceBase instance, + ExpNode indexExpression ) + : base( source ) + { + _collection = instance; + _indexExpression = indexExpression; + CodeConvertTemplate = @"{0}[{1}]"; + } + + public override ExpNode Left => _collection; + + public override ExpNode Right => _indexExpression; + + public override IExpElementSource EqualityTypeConvert => _collection.EqualityTypeConvert; + + public static ExpCollectionIndexNode Create( + Token source, + ExpCollectionInstanceBase instance, + ExpNode indexExpression ) + { + if( !indexExpression.IsNumber ) { + throw new ExpInvalidTypeException( + "Number", indexExpression.EqualityTypeConvert.Name ); + } + return new ExpCollectionIndexNode( + source, instance, indexExpression ); + } + + } +} diff --git a/StgSharp.Script/Express/ExpAstNode/ExpLiteralNode.cs b/StgSharp.Script/Express/ExpAstNode/ExpLiteralNode.cs index 88c0dadd..af000c5f 100644 --- a/StgSharp.Script/Express/ExpAstNode/ExpLiteralNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/ExpLiteralNode.cs @@ -1,6 +1,6 @@ //----------------------------------------------------------------------- //----------------------------------------------------------------------- -// file="ExpLiteralGenericNode.cs" +// file="ExpLiteralNode.cs" // Project: StgSharp // AuthorGroup: Nitload Space // Copyright (c) Nitload Space. All rights reserved. @@ -51,12 +51,13 @@ namespace StgSharp.Script.Express public override IExpElementSource EqualityTypeConvert => ExpSchema.BuiltinSchema .TryGetType( - ExpCompile.KeyWord.Int, out ExpTypeSource? type ) ? + ExpCompile.KeyWord.Integer, + out ExpTypeSource? type ) ? type : throw new ExpCompileNotInitializedException(); public int Value => _value; - public override string TypeName => ExpCompile.KeyWord.Int; + public override string TypeName => ExpCompile.KeyWord.Integer; } @@ -100,7 +101,8 @@ namespace StgSharp.Script.Express public override IExpElementSource EqualityTypeConvert => ExpSchema.BuiltinSchema .TryGetType( - ExpCompile.KeyWord.Bool, out ExpTypeSource? type ) ? + ExpCompile.KeyWord.Boolean, + out ExpTypeSource? type ) ? type : throw new ExpCompileNotInitializedException(); public override string TypeName => EqualityTypeConvert.Name; @@ -147,7 +149,7 @@ namespace StgSharp.Script.Express public override IExpElementSource EqualityTypeConvert => ExpSchema.BuiltinSchema .TryGetType( - ExpCompile.KeyWord.Logic, + ExpCompile.KeyWord.Logical, out ExpTypeSource? type ) ? type : throw new ExpCompileNotInitializedException(); diff --git a/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs b/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs index 9b25118c..3c69c279 100644 --- a/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs +++ b/StgSharp.Script/Express/ExpAstNode/_ExpNode.cs @@ -32,6 +32,7 @@ using CommunityToolkit.HighPerformance.Buffers; using System; using System.Collections.Generic; +using System.Linq; using System.Runtime.CompilerServices; using System.Text; diff --git a/StgSharp.Script/Express/ExpNodeGenerator.Operator.cs b/StgSharp.Script/Express/ExpNodeGenerator.Operator.cs index 3a57cd34..a66a5ce2 100644 --- a/StgSharp.Script/Express/ExpNodeGenerator.Operator.cs +++ b/StgSharp.Script/Express/ExpNodeGenerator.Operator.cs @@ -53,16 +53,16 @@ namespace StgSharp.Script.Express ExpNode left = GetNextOperandCache(); ExpNode right = GetNextOperandCache(); switch( t.Value ) { - case ExpCompile.KeyWord.ADD: + case ExpCompile.KeyWord.Add: node = ExpBinaryOperatorNode.Add( t, left, right ); return true; - case ExpCompile.KeyWord.SUB: + case ExpCompile.KeyWord.Sub: node = ExpBinaryOperatorNode.Sub( t, left, right ); return true; - case ExpCompile.KeyWord.MUL: + case ExpCompile.KeyWord.Mul: node = ExpBinaryOperatorNode.Mul( t, left, right ); return true; - case ExpCompile.KeyWord.DIV: + case ExpCompile.KeyWord.Div: node = ExpBinaryOperatorNode.Div( t, left, right ); return true; case ExpCompile.KeyWord.Equal: @@ -88,7 +88,7 @@ namespace StgSharp.Script.Express case ExpCompile.KeyWord.UnaryMinus: node = ExpUnaryOperatorNode.UnaryMinus( t, operand ); return true; - case ExpCompile.KeyWord.NOT: + case ExpCompile.KeyWord.Not: node = ExpUnaryOperatorNode.UnaryNot( t, operand ); return true; default: diff --git a/StgSharp.Script/Express/ExpNodeGenerator.cs b/StgSharp.Script/Express/ExpNodeGenerator.cs index 92bf56c7..099fc87e 100644 --- a/StgSharp.Script/Express/ExpNodeGenerator.cs +++ b/StgSharp.Script/Express/ExpNodeGenerator.cs @@ -169,10 +169,7 @@ namespace StgSharp.Script.Express } else if( t.Value == ExpKeyWord.False ) { _cache.PushOperand( new ExpBoolNode( t, false ) ); return true; - } else if( true ) { - throw new NotImplementedException(); - } - return false; + } else if( ExpCompile.LetterIsKeyword( t.Value ) ) { } } /**/ diff --git a/StgSharp.Script/Express/ExpSourceReader.cs b/StgSharp.Script/Express/ExpSourceReader.cs index 0e19aedb..28bf2cbf 100644 --- a/StgSharp.Script/Express/ExpSourceReader.cs +++ b/StgSharp.Script/Express/ExpSourceReader.cs @@ -77,10 +77,10 @@ namespace StgSharp.Script.Express } /// - /// Read code until end of a line. Lines in multi-line comment will be ignored. Line + /// Read code until end of a line. Lines in multi-line comment will be ignored. Line /// begins with part of multi-line comment will automatically remove the comment part, but - /// beginning with a full multi-line comment will not causing removing. (*Just - /// Like The Comment Here*) Will Not Be Removed + /// beginning with a full multi-line comment will not causing removing. (*Just + /// Like The Comment Here*) Will Not Be Removed /// /// public unsafe ReadOnlySpan ReadLine() @@ -267,7 +267,7 @@ namespace StgSharp.Script.Express string str = ExpCompile.PoolString( source[ ..( end - begin ) ] ); TokenFlag flag; - if( ReferenceEquals( str, ExpCompile.KeyWord.NOT ) ) { + if( ReferenceEquals( str, ExpCompile.KeyWord.Not ) ) { flag = TokenFlag.Symbol_Unary; } else { flag = ExpCompile.LetterIsOperator( str ) ? diff --git a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs index 551235f5..48db1393 100644 --- a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs +++ b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.AssemblyInfo.cs @@ -14,7 +14,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+9647c2c68a768a1d0a5a05cc1279d046403c4641")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+6222f8c8be57d511d2ec40523717e20b87fcff9d")] [assembly: System.Reflection.AssemblyProductAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyTitleAttribute("StgSharp.Script")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json index fdd23080..bbe5bf39 100644 --- a/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json +++ b/StgSharp.Script/obj/x64/Debug/net8.0/StgSharp.Script.sourcelink.json @@ -1 +1 @@ -{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/9647c2c68a768a1d0a5a05cc1279d046403c4641/*"}} \ No newline at end of file +{"documents":{"D:\\NitloadIndustry\\研究项目\\1-Flagship\\TH2020\\ProjectFile\\内核源代码\\*":"https://raw.githubusercontent.com/Nitload-NSI/CCD_Github/6222f8c8be57d511d2ec40523717e20b87fcff9d/*"}} \ No newline at end of file