mirror of https://github.com/japl-lang/japl.git
Fixed debugger bugs
Made exponentiation larger precedence than unary
This commit is contained in:
parent
9e4329981c
commit
8fe70d2f95
|
@ -71,8 +71,8 @@ type
|
|||
Comparison,
|
||||
Term,
|
||||
Factor,
|
||||
Exponentiation,
|
||||
Unary,
|
||||
Exponentiation,
|
||||
Call,
|
||||
Primary
|
||||
|
||||
|
|
|
@ -79,10 +79,11 @@ const simpleInstructions* = {OpCode.Return, OpCode.Add, OpCode.Multiply,
|
|||
OpCode.Inf, OpCode.Shl, OpCode.Shr,
|
||||
OpCode.Xor, OpCode.Not, OpCode.Equal,
|
||||
OpCode.Greater, OpCode.Less, OpCode.GetItem,
|
||||
OpCode.Slice, OpCode.Pop, OpCode.DefineGlobal,
|
||||
OpCode.GetGlobal, OpCode.SetGlobal,
|
||||
OpCode.DeleteGlobal}
|
||||
const constantInstructions* = {OpCode.Constant}
|
||||
OpCode.Slice, OpCode.Pop, OpCode.Negate}
|
||||
const constantInstructions* = {OpCode.Constant, OpCode.DefineGlobal,
|
||||
OpCode.GetGlobal, OpCode.SetGlobal,
|
||||
OpCode.DeleteGlobal}
|
||||
|
||||
const constantLongInstructions* = {OpCode.ConstantLong}
|
||||
const byteInstructions* = {OpCode.SetLocal, OpCode.GetLocal, OpCode.DeleteLocal,
|
||||
OpCode.Call}
|
||||
|
|
|
@ -30,7 +30,7 @@ proc simpleInstruction(name: string, index: int): int =
|
|||
proc byteInstruction(name: string, chunk: Chunk, offset: int): int =
|
||||
var slot = chunk.code[offset + 1]
|
||||
echo &"\tInstruction at IP: {name}, points to slot {slot}\n"
|
||||
return offset + 1
|
||||
return offset + 2
|
||||
|
||||
|
||||
proc constantLongInstruction(name: string, chunk: Chunk, offset: int): int =
|
||||
|
|
Loading…
Reference in New Issue