Compilation with ground->asm

This commit is contained in:
2026-01-21 16:26:17 +11:00
parent 9397f410da
commit c82f81f668
4 changed files with 65 additions and 36 deletions

View File

@@ -2,6 +2,7 @@
#include "error.h"
#include "lexer.h"
#include "solstice_stdlib.h"
#include "argparser.h"
#include <groundvm.h>
#include <cstring>
#include <string>
@@ -209,9 +210,11 @@ namespace Solstice {
std::vector<SolGroundCodeBlock> code;
if (nodeType == SolNodeType::Root) {
// Compile and insert standard library
auto parsedStdlib = Parser(Lexer(getStdLib()).lex()).parse();
parsedStdlib.nodeType = SolNodeType::None;
code = parsedStdlib.generateCode();
if (!ArgParser::nostdlib) {
auto parsedStdlib = Parser(Lexer(getStdLib()).lex()).parse();
parsedStdlib.nodeType = SolNodeType::None;
code = parsedStdlib.generateCode();
}
}
if (nodeType != SolNodeType::If && nodeType != SolNodeType::While) for (auto& child : children) {
auto childCode = child.generateCode();