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

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle the case where !PREFIX_* returns a nested array.
  • Loading branch information
pmichaud committed Oct 22, 2009
1 parent c82db7d commit 4388311
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/Regex/Cursor-protoregex-peek.pir
Expand Up @@ -230,13 +230,6 @@ called C<name>.
tokens = new ['ResizablePMCArray']
push tokens, ''
method_peek_done:
# printerr name
# printerr ' '
# printerr $S0
# printerr ' tokens=('
# $S0 = join ' ', tokens
# printerr $S0
# printerr ")\n"

# Now loop through all of the tokens for the method, updating
# the longest initial key and adding it to the tokrx hash.
Expand All @@ -248,12 +241,13 @@ called C<name>.
tokens_loop:
unless tokens goto tokens_done
.local string tkey, tfirst
tkey = ''
$P0 = shift tokens
$I0 = isa $P0, ['Regex';'Cursor']
if $I0 goto have_tkey
$I0 = isa $P0, ['ResizablePMCArray']
unless $I0 goto token_item
splice tokens, $P0, 0, 0
goto tokens_loop
token_item:
tkey = $P0
have_tkey:

# If we've already processed this token for this rule, don't enter it twice
$I0 = exists seentok[tkey]
Expand Down

0 comments on commit 4388311

Please sign in to comment.