Skip to content

Commit

Permalink
Fixing line value for constants
Browse files Browse the repository at this point in the history
  • Loading branch information
patbuc committed Jul 5, 2024
1 parent c9287f0 commit 2f1e2f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/compiler/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ impl Parser {
}

fn emit_constant(&mut self, value: Value) {
self.current_block().write_constant(value, 0)
let line = self.previous_token.line;
self.current_block().write_constant(value, line)
}

fn emit_op_code(&mut self, op_code: OpCode) {
Expand Down

0 comments on commit 2f1e2f9

Please sign in to comment.