Daily update on 20250320-081135 by Nitload Youmu. Additional Message : Compiler Framework rebuild compelte, working on reverse converter

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-20 08:11:35 +08:00
parent 6788bc4a00
commit e73d2fd7fb
22 changed files with 394 additions and 172 deletions
+29
View File
@@ -34,6 +34,7 @@ using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace StgSharp.Script.Express
@@ -57,6 +58,25 @@ namespace StgSharp.Script.Express
}
public class ExpInvalidSyntaxException : Exception
{
public ExpInvalidSyntaxException( string message ) : base( message ) { }
public static void ThrowNonCollectionIndex( Token t )
{
throw new ExpInvalidSyntaxException(
$"Use a collection indexer to a non-collection variable at line {t.Line} column {t.Column}" );
}
public static void ThrowNoOperator( Token t )
{
throw new ExpInvalidSyntaxException(
$"No operator but more than one operand before line {t.Line} column {t.Column}" );
}
}
public class ExpInvalidElementDeclareEndingExceptions : Exception
{
@@ -136,4 +156,13 @@ namespace StgSharp.Script.Express
"Attempt to compile an EXPRESS script before the init of compiler." ) { }
}
public class ExpCompileException : Exception
{
public ExpCompileException( Token pos, string message )
: base(
$"Compiler exception occour when processing token at line {pos.Line}, column {pos.Column}. Detailed message:{Environment.NewLine}{message} " ) { }
}
}