Add better error message
This commit is contained in:
@@ -522,7 +522,14 @@ namespace Tesses::CrossLang
|
||||
TWO_EXPR(NotEqualsExpression, NEQ)
|
||||
TWO_EXPR(EqualsExpression, EQ)
|
||||
TWO_EXPR(XOrExpression, XOR)
|
||||
if(adv.nodeName == NullCoalescingExpression && adv.nodes.size() == 2)
|
||||
if(adv.nodeName == LineNode && adv.nodes.size() == 2)
|
||||
{
|
||||
|
||||
GenNode(instructions,adv.nodes[0],scope,contscope,brkscope,contI,brkI);
|
||||
GenNode(instructions,adv.nodes[1],scope,contscope,brkscope,contI,brkI);
|
||||
instructions.push_back(new SimpleInstruction(LINEINFO));
|
||||
}
|
||||
else if(adv.nodeName == NullCoalescingExpression && adv.nodes.size() == 2)
|
||||
{
|
||||
uint32_t ifId = NewId();
|
||||
std::string ifIdTrue = "__compGenTrue";
|
||||
|
||||
@@ -1304,6 +1304,15 @@ namespace Tesses::CrossLang
|
||||
}
|
||||
return node;
|
||||
}
|
||||
bool Parser::CanEmit(LexTokenLineInfo& ifo)
|
||||
{
|
||||
if(!this->debug) return false;
|
||||
bool same = ifo.line == this->lastLine && ifo.filename == this->lastFile;
|
||||
this->lastFile = ifo.filename;
|
||||
this->lastLine = ifo.line;
|
||||
|
||||
return !same;
|
||||
}
|
||||
SyntaxNode Parser::ParseNode(bool isRoot)
|
||||
{
|
||||
std::string documentation="";
|
||||
@@ -1324,6 +1333,8 @@ namespace Tesses::CrossLang
|
||||
|
||||
while(i < tokens.size() && (isRoot || !IsSymbol("}",false)))
|
||||
{
|
||||
auto token = tokens[i];
|
||||
if(CanEmit(token.lineInfo)) aSN.nodes.push_back(AdvancedSyntaxNode::Create(LineNode,false, {(int64_t)tokens[i].lineInfo.line,tokens[i].lineInfo.filename}));
|
||||
aSN.nodes.push_back(ParseNode());
|
||||
IsSymbol(";");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user