Skip to content

Commit f81b6c2

Browse files
committed
return 1-based line numbers of HLL::Compiler.lineof
1 parent 2695eea commit f81b6c2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/HLL/Compiler.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@ class HLL::Compiler {
660660
inc line
661661
goto line_loop
662662
line_done:
663+
# line numbers are generall 1-based
664+
inc line
663665
.return (line)
664666
};
665667
}

src/HLL/Grammar.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ of the match.
318318
my $pos := self.pos();
319319
my $target := pir::getattribute__PPPs(self, Regex::Cursor, '$!target');
320320
@args.push(' at line ');
321-
@args.push(HLL::Compiler.lineof($target, $pos) + 1);
321+
@args.push(HLL::Compiler.lineof($target, $pos));
322322
@args.push(', near "');
323323
@args.push(pir::escape__SS(pir::substr($target, $pos, 10)));
324324
@args.push('"');

0 commit comments

Comments
 (0)