Daily update on 20250430-073804 by Nitload Youmu. Additional Message : full function of syntax analyze to STEP file

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-04-30 07:38:04 +08:00
parent a6411e2f25
commit 74c01effe4
52 changed files with 693 additions and 442 deletions
+23 -2
View File
@@ -42,8 +42,23 @@ namespace StgSharp.Script.Express
public class ExpException : Exception
{
private Token _pos;
public ExpException( string message ) : base( message ) { }
public ExpException( Token position, string message )
: base( $"Express compile error at {position.Line}-{position.Column}:\n{message}" )
{
_pos = position;
}
public ExpException( ExpSyntaxNode node, string message )
: base(
$"Express compile error at {node.Source.Line}-{node.Source.Column}:\n{message}" )
{
_pos = node._source;
}
}
public class ExpInvalidCharException : ExpException
@@ -100,11 +115,17 @@ namespace StgSharp.Script.Express
}
public class ExpInvalidTypeException : InvalidCastException
public class ExpInvalidTypeException : ExpException
{
public ExpInvalidTypeException( string required, string provided )
public ExpInvalidTypeException( ExpSyntaxNode node, string required, string provided )
: base(
node,
$"Type {required} is required at position, but a {provided} instance is provided." ) { }
public ExpInvalidTypeException( Token t, string required, string provided )
: base(
t,
$"Type {required} is required at position, but a {provided} instance is provided." ) { }
}