Minor bug fixes
This commit is contained in:
parent
ffee77b6fc
commit
e8cbec94bd
|
@ -988,6 +988,8 @@ proc expression(self: Compiler, node: Expression) =
|
|||
# error in self.identifier()
|
||||
self.error("expression has no type")
|
||||
case node.kind:
|
||||
of callExpr:
|
||||
discard # TODO
|
||||
of getItemExpr:
|
||||
discard # TODO
|
||||
# Note that for setItem and assign we don't convert
|
||||
|
|
|
@ -103,7 +103,7 @@ proc addOperator(self: OperatorTable, lexeme: string) =
|
|||
if lexeme in self.tokens:
|
||||
return # We've already added it!
|
||||
var prec = Precedence.high()
|
||||
if lexeme.len() >= 2 and lexeme[^3..^1] in ["->", "~>", "=>"]:
|
||||
if lexeme.len() >= 2 and lexeme[^2..^1] in ["->", "~>", "=>"]:
|
||||
prec = Arrow
|
||||
elif lexeme.endsWith("=") and lexeme[0] notin {'<', '>', '!', '?', '~', '='}:
|
||||
prec = Assign
|
||||
|
|
|
@ -109,9 +109,9 @@ proc jumpInstruction(instruction: OpCode, chunk: Chunk, offset: int): int =
|
|||
## Debugs jumps
|
||||
var jump: int
|
||||
case instruction:
|
||||
of JumpIfFalse, JumpIfTrue, JumpIfFalsePop, JumpForwards, JumpBackwards:
|
||||
of Jump, JumpIfFalse, JumpIfTrue, JumpIfFalsePop, JumpForwards, JumpBackwards:
|
||||
jump = [chunk.code[offset + 1], chunk.code[offset + 2]].fromDouble().int()
|
||||
of LongJumpIfFalse, LongJumpIfTrue, LongJumpIfFalsePop, LongJumpForwards, LongJumpBackwards:
|
||||
of LongJump, LongJumpIfFalse, LongJumpIfTrue, LongJumpIfFalsePop, LongJumpForwards, LongJumpBackwards:
|
||||
jump = [chunk.code[offset + 1], chunk.code[offset + 2], chunk.code[offset + 3]].fromTriple().int()
|
||||
else:
|
||||
discard # Unreachable
|
||||
|
|
Loading…
Reference in New Issue