Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Switch 'lineof' method calls to use the version of HLL::Compiler inst…
Browse files Browse the repository at this point in the history
…ead of CodeString.
  • Loading branch information
pmichaud committed Sep 8, 2010
1 parent ce60da8 commit bb5d370
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/Regex/Cursor-builtins.pir
Expand Up @@ -225,12 +225,11 @@ Regex::Cursor-builtins - builtin regexes for Cursor objects
message = concat "Unable to parse ", dba
message .= ", couldn't find final "
message .= goal
$P0 = getattribute self, '$!target'
$I0 = can $P0, 'lineof'
unless $I0 goto have_line
message .= ' at line '
$P0 = getattribute self, '$!target'
$P1 = get_hll_global ['HLL'], 'Compiler'
$I0 = self.'pos'()
$I0 = $P0.'lineof'($I0)
$I0 = $P1.'lineof'($P0, $I0)
inc $I0
$S0 = $I0
message .= $S0
Expand Down
3 changes: 2 additions & 1 deletion src/Regex/Cursor.pir
Expand Up @@ -482,7 +482,8 @@ Log a debug message.
fmt = new ['ResizablePMCArray']
from = getattribute self, '$!from'
orig = getattribute self, '$!target'
line = orig.'lineof'(from)
$P0 = get_hll_global ['HLL'], 'Compiler'
line = $P0.'lineof'(orig, from, 'cache'=>1)

$P0 = getinterp
$P1 = $P0.'stdhandle'(2)
Expand Down
3 changes: 2 additions & 1 deletion src/cheats/hll-grammar.pir
Expand Up @@ -202,7 +202,8 @@ of the match.
pos = self.'pos'()
target = getattribute self, '$!target'
$I1 = target.'lineof'(pos)
$P0 = get_hll_global ['HLL'], 'Compiler'
$I1 = $P0.'lineof'(target, pos)
inc $I1
push args, ' at line '
push args, $I1
Expand Down

0 comments on commit bb5d370

Please sign in to comment.