Fix lexer

This commit is contained in:
2025-12-19 17:01:57 +11:00
parent b5c8b1b7ec
commit e8bf7b70f7

View File

@@ -165,9 +165,6 @@ namespace HighGround {
break; break;
} }
case HGNodeType::Equal: { case HGNodeType::Equal: {
std::cout << "Equal node children: " << children.size() << "\n";
std::cout << "Left outputId: '" << children[0].outputId << "'\n";
std::cout << "Right outputId: '" << children[1].outputId << "'\n";
HGGroundCodeBlock codeBlock; HGGroundCodeBlock codeBlock;
outputId = "tmp_" + std::to_string(tmpIdIterator++); outputId = "tmp_" + std::to_string(tmpIdIterator++);
GroundInstruction gi = groundCreateInstruction(EQUAL); GroundInstruction gi = groundCreateInstruction(EQUAL);
@@ -480,7 +477,6 @@ namespace HighGround {
} }
codeBlockNode.children = Parser(tokens).parse().children; codeBlockNode.children = Parser(tokens).parse().children;
rootNode.addNode(codeBlockNode); rootNode.addNode(codeBlockNode);
// WIP
break; break;
} }
} }
@@ -551,7 +547,7 @@ namespace HighGround {
case '-': case '-':
{ {
std::string newToken(1, c); std::string newToken(1, c);
auto tokenopt = peek(); auto tokenopt = peek(0);
if (tokenopt) { if (tokenopt) {
char token = tokenopt.value(); char token = tokenopt.value();
if (token == c || token == '=') { if (token == c || token == '=') {
@@ -572,7 +568,7 @@ namespace HighGround {
case '=': case '=':
{ {
std::string newToken(1, c); std::string newToken(1, c);
auto tokenopt = peek(); auto tokenopt = peek(0);
if (tokenopt) { if (tokenopt) {
char token = tokenopt.value(); char token = tokenopt.value();
if (token == '=') { if (token == '=') {