mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
up
This commit is contained in:
parent
1e73f7e1bf
commit
3d40a3d51f
@ -50,7 +50,7 @@ struct SourceData {
|
|||||||
|
|
||||||
this->filename = filename;
|
this->filename = filename;
|
||||||
this->source = ss.str();
|
this->source = ss.str();
|
||||||
line_starts.push_back(source);
|
line_starts.push_back(this->source.c_str());
|
||||||
this->mode = mode;
|
this->mode = mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,10 +280,10 @@ struct NegatedExpr: Expr{
|
|||||||
LiteralExpr* lit = static_cast<LiteralExpr*>(child.get());
|
LiteralExpr* lit = static_cast<LiteralExpr*>(child.get());
|
||||||
PyObject* obj = nullptr;
|
PyObject* obj = nullptr;
|
||||||
if(std::holds_alternative<i64>(lit->value)){
|
if(std::holds_alternative<i64>(lit->value)){
|
||||||
obj = VAR(std::get<i64>(lit->value));
|
obj = VAR(-std::get<i64>(lit->value));
|
||||||
}
|
}
|
||||||
if(std::holds_alternative<f64>(lit->value)){
|
if(std::holds_alternative<f64>(lit->value)){
|
||||||
obj = VAR(std::get<f64>(lit->value));
|
obj = VAR(-std::get<f64>(lit->value));
|
||||||
}
|
}
|
||||||
if(obj != nullptr){
|
if(obj != nullptr){
|
||||||
ctx->emit(OP_LOAD_CONST, ctx->add_const(obj), line);
|
ctx->emit(OP_LOAD_CONST, ctx->add_const(obj), line);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user