mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-24 21:40:16 +00:00
fix neg constant
This commit is contained in:
parent
6067436e46
commit
ce0ba313d1
@ -65,6 +65,8 @@ struct CodeObject {
|
|||||||
std::vector<CodeBlock> blocks = { CodeBlock{NO_BLOCK, -1} };
|
std::vector<CodeBlock> blocks = { CodeBlock{NO_BLOCK, -1} };
|
||||||
emhash8::HashMap<Str, int> labels;
|
emhash8::HashMap<Str, int> labels;
|
||||||
|
|
||||||
|
void optimize(VM* vm);
|
||||||
|
|
||||||
bool add_label(const Str& label){
|
bool add_label(const Str& label){
|
||||||
if(labels.contains(label)) return false;
|
if(labels.contains(label)) return false;
|
||||||
labels[label] = codes.size();
|
labels[label] = codes.size();
|
||||||
@ -86,8 +88,6 @@ struct CodeObject {
|
|||||||
return consts.size() - 1;
|
return consts.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void optimize(VM* vm);
|
|
||||||
|
|
||||||
/************************************************/
|
/************************************************/
|
||||||
int _curr_block_i = 0;
|
int _curr_block_i = 0;
|
||||||
bool _rvalue = false;
|
bool _rvalue = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user