mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
WIP
This commit is contained in:
parent
fd60746f6a
commit
819dc93501
6 changed files with 46 additions and 52 deletions
|
@ -589,15 +589,16 @@ impl CodeObj {
|
|||
)
|
||||
.unwrap();
|
||||
}
|
||||
Opcode311::POP_JUMP_FORWARD_IF_FALSE
|
||||
| Opcode311::POP_JUMP_FORWARD_IF_TRUE => {
|
||||
Opcode311::POP_JUMP_FORWARD_IF_FALSE | Opcode311::POP_JUMP_FORWARD_IF_TRUE => {
|
||||
write!(instrs, "{arg} (to {})", idx + *arg as usize * 2 + 2).unwrap();
|
||||
}
|
||||
Opcode311::JUMP_BACKWARD => {
|
||||
write!(instrs, "{arg} (to {})", idx - *arg as usize * 2 + 2).unwrap();
|
||||
}
|
||||
Opcode311::PRECALL | Opcode311::CALL
|
||||
| Opcode311::COPY | Opcode311::SWAP
|
||||
Opcode311::PRECALL
|
||||
| Opcode311::CALL
|
||||
| Opcode311::COPY
|
||||
| Opcode311::SWAP
|
||||
| Opcode311::COPY_FREE_VARS => {
|
||||
write!(instrs, "{arg}").unwrap();
|
||||
}
|
||||
|
@ -640,12 +641,7 @@ impl CodeObj {
|
|||
| CommonOpcode::LOAD_METHOD
|
||||
| CommonOpcode::IMPORT_NAME
|
||||
| CommonOpcode::IMPORT_FROM => {
|
||||
write!(
|
||||
instrs,
|
||||
"{arg} ({})",
|
||||
self.names.get(*arg as usize).unwrap()
|
||||
)
|
||||
.unwrap();
|
||||
write!(instrs, "{arg} ({})", self.names.get(*arg as usize).unwrap()).unwrap();
|
||||
}
|
||||
CommonOpcode::STORE_FAST | CommonOpcode::LOAD_FAST => {
|
||||
write!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue