Daily update on 20250325-164701 by Nitload Youmu. Additional Message : Lineaar line and multi-linear line compile full function. String literal parsing improve.

Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
Nitload
2025-03-25 16:47:02 +08:00
parent ffd5825a05
commit 469cb88472
29 changed files with 414 additions and 273 deletions
@@ -41,43 +41,44 @@ namespace StgSharp.Script.Express
//TODO: Current code cannot represent full functionality defined in ISO10303, need rewrite.
private ExpElementInstanceBase _variable, _begin, _end, _increment;
private ExpElementInstance _variable, _begin, _end, _increment;
private ExpNode _operationBegin;
public ExpRepeatNode(
Token source,
ExpNode operationBegin,
ExpElementInstanceBase variable,
ExpElementInstanceBase begin,
ExpElementInstanceBase end,
ExpElementInstanceBase increment )
Token source,
ExpNode operationBegin,
ExpElementInstance variable,
ExpElementInstance begin,
ExpElementInstance end,
ExpElementInstance increment )
: base( source )
{
if( variable.NodeFlag != begin.NodeFlag || begin.NodeFlag !=
end.NodeFlag || ( increment != null && end.NodeFlag !=
increment.NodeFlag ) ) {
if( variable.NodeFlag != begin.NodeFlag || begin.NodeFlag != end.NodeFlag || ( increment !=
null && end.NodeFlag !=
increment.NodeFlag ) ) {
throw new InvalidCastException();
}
if( increment == null ) {
switch( ( ExpNodeFlag )variable.NodeFlag | ExpNodeFlag.BuiltinType_Any ) {
if( increment == null )
{
switch( ( ExpNodeFlag )variable.NodeFlag | ExpNodeFlag.BuiltinType_Any )
{
case ExpNodeFlag.BuiltinType_Real:
increment = new ExpRealNumberNode(
new Token(
ExpressCompile.PoolString( "1.0f" ), source.Line,
-1, TokenFlag.Number ),
1.0f );
ExpressCompile.PoolString( "1.0f" ), source.Line, -1,
TokenFlag.Number ),
1.0f, isLiteral: true );
break;
case ExpNodeFlag.BuiltinType_Int:
increment = new ExpIntNode(
new Token(
ExpressCompile.PoolString( "1" ), source.Line, -1,
TokenFlag.Number ),
1 );
1, isLiteral: true );
break;
default:
throw new ExpInvalidTypeException(
"Int or Real", "otherwise" );
throw new ExpInvalidTypeException( "Int or Real", "otherwise" );
}
}
_begin = begin;