mirror of
https://onedev.site.tesses.net/crosslang
synced 2026-02-09 01:25:45 +00:00
2-27-2025
This commit is contained in:
@@ -911,7 +911,7 @@ namespace Tesses::CrossLang
|
||||
contscope = old_contscope;
|
||||
brkscope = old_brkscope;
|
||||
}
|
||||
else if(adv.nodeName == CommaExpression && adv.nodeName.size() == 2)
|
||||
else if(adv.nodeName == CommaExpression && adv.nodes.size() == 2)
|
||||
{
|
||||
GenNode(instructions,adv.nodes[0],scope,contscope,brkscope,contI,brkI);
|
||||
GenPop(instructions,adv.nodes[0]);
|
||||
|
||||
@@ -165,6 +165,14 @@ namespace Tesses::CrossLang
|
||||
node = AdvancedSyntaxNode::Create(GetVariableExpression, true,{"operator"+variable.text});
|
||||
|
||||
}
|
||||
else if(IsIdentifier("new"))
|
||||
{
|
||||
if(i >= tokens.size()) throw std::out_of_range("End of file");
|
||||
auto variable = tokens[i];
|
||||
i++;
|
||||
if(variable.type != LexTokenType::Identifier && variable.type != LexTokenType::Symbol) throw SyntaxException(variable.lineInfo, "Expected an identifier or a symbol got a " + LexTokenType_ToString(variable.type) + " \"" + variable.text + "\"");
|
||||
node = AdvancedSyntaxNode::Create(GetFieldExpression, true, {AdvancedSyntaxNode::Create(GetVariableExpression,true,{"New"}), variable.text});
|
||||
}
|
||||
else if(IsIdentifier("embed"))
|
||||
{
|
||||
EnsureSymbol("(");
|
||||
@@ -339,6 +347,7 @@ namespace Tesses::CrossLang
|
||||
{
|
||||
return AdvancedSyntaxNode::Create(PrefixDecrementExpression,true,{ParseUnary()});
|
||||
}
|
||||
|
||||
return ParseValue();
|
||||
}
|
||||
|
||||
@@ -557,6 +566,10 @@ namespace Tesses::CrossLang
|
||||
}
|
||||
return AdvancedSyntaxNode::Create(EachStatement,false,{item,list,body});
|
||||
}
|
||||
if(IsIdentifier("object"))
|
||||
{
|
||||
//TODO: complete this
|
||||
}
|
||||
if(IsIdentifier("enumerable"))
|
||||
{
|
||||
auto nameAndArgs = ParseExpression();
|
||||
|
||||
Reference in New Issue
Block a user