🐛 fix ast print bug & delete some macros

This commit is contained in:
ValKmjolnir
2022-10-30 18:40:03 +08:00
parent a366b1fc75
commit be42d47c93
13 changed files with 197 additions and 181 deletions
+3 -3
View File
@@ -264,7 +264,7 @@ private:
void singleop(const u32);
public:
codegen(error& e):fileindex(0),err(e),file(nullptr){}
void compile(const parse&,const linker&);
const error& compile(const parse&,const linker&);
void print();
const std::vector<string>& strs() const {return str_res;}
const std::vector<f64>& nums() const {return num_res;}
@@ -1235,7 +1235,7 @@ void codegen::ret_gen(const ast& node)
gen(op_ret,0,node.line());
}
void codegen::compile(const parse& parse,const linker& import)
const error& codegen::compile(const parse& parse,const linker& import)
{
fileindex=0;
file=import.filelist().data();
@@ -1248,7 +1248,7 @@ void codegen::compile(const parse& parse,const linker& import)
die("too many global variants: "+std::to_string(global.size()),0,0);
if(code.size()>0xffffffff)
die("too large generated bytecode file: "+std::to_string(code.size()),0,0);
err.chkerr();
return err;
}
void codegen::singleop(const u32 index)