Author: pmichaud
Date: Tue Apr  3 19:36:12 2007
New Revision: 17969

Added:
   trunk/compilers/pge/PGE/Perl6Regex.pir
      - copied, changed from r17964, /trunk/compilers/pge/PGE/P6Regex.pir
   trunk/t/compilers/pge/perl6regex/
   trunk/t/compilers/pge/perl6regex/01-regex.t
      - copied, changed from r17964, /trunk/t/compilers/pge/p6regex/01-regex.t
   trunk/t/compilers/pge/perl6regex/rx_backtrack
      - copied unchanged from r17964, 
/trunk/t/compilers/pge/p6regex/rx_backtrack
   trunk/t/compilers/pge/perl6regex/rx_charclass
      - copied, changed from r17964, /trunk/t/compilers/pge/p6regex/rx_charclass
Modified:
   trunk/MANIFEST
   trunk/compilers/pge/PGE.pir
   trunk/compilers/pge/PGE/P6Regex.pir
   trunk/config/gen/makefiles/pge.in
   trunk/t/compilers/pge/pge.t

Log:
[pge]:
* Add initial version of Perl6Regex
* Accepts new 'quoting' operator
* Initial refactor of perl6regex test suite


Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Tue Apr  3 19:36:12 2007
@@ -111,6 +111,7 @@
 compilers/pge/PGE/OPTable.pir                               []
 compilers/pge/PGE/P5Regex.pir                               []
 compilers/pge/PGE/P6Regex.pir                               []
+compilers/pge/PGE/Perl6Regex.pir                            []
 compilers/pge/PGE/Regex.pir                                 []
 compilers/pge/PGE/builtins.pg                               []
 compilers/pge/PGE/pmc/codestring.pmc                        []
@@ -2738,6 +2739,9 @@
 t/compilers/pge/p6regex/subrules.t                          []
 t/compilers/pge/p6regex/syntax_errors.t                     []
 t/compilers/pge/p6regex/text_brk.t                          []
+t/compilers/pge/perl6regex/01-regex.t                       []
+t/compilers/pge/perl6regex/rx_backtrack                     []
+t/compilers/pge/perl6regex/rx_charclass                     []
 t/compilers/pge/pge-hs.t                                    []
 t/compilers/pge/pge.t                                       []
 t/compilers/pge/pge_examples.t                              []

Modified: trunk/compilers/pge/PGE.pir
==============================================================================
--- trunk/compilers/pge/PGE.pir (original)
+++ trunk/compilers/pge/PGE.pir Tue Apr  3 19:36:12 2007
@@ -17,6 +17,7 @@
 .include "compilers/pge/PGE/OPTable.pir"
 .include "compilers/pge/PGE/Regex.pir"
 .include "compilers/pge/PGE/Exp.pir"
+.include "compilers/pge/PGE/Perl6Regex.pir"
 .include "compilers/pge/PGE/P6Regex.pir"
 .include "compilers/pge/PGE/P5Regex.pir"
 .include "compilers/pge/PGE/builtins_gen.pir"

Modified: trunk/compilers/pge/PGE/P6Regex.pir
==============================================================================
--- trunk/compilers/pge/PGE/P6Regex.pir (original)
+++ trunk/compilers/pge/PGE/P6Regex.pir Tue Apr  3 19:36:12 2007
@@ -160,9 +160,6 @@
 .sub '__onload' :load
     .local pmc optable
 
-    $P0 = subclass 'PGE::Exp::Subrule', 'PGE::Exp::WS'
-    $P0 = subclass 'PGE::Exp', 'PGE::Exp::Alias'
-
     optable = new 'PGE::OPTable'
     set_global '$optable', optable
 

Copied: trunk/compilers/pge/PGE/Perl6Regex.pir (from r17964, 
/trunk/compilers/pge/PGE/P6Regex.pir)
==============================================================================
--- /trunk/compilers/pge/PGE/P6Regex.pir        (original)
+++ trunk/compilers/pge/PGE/Perl6Regex.pir      Tue Apr  3 19:36:12 2007
@@ -1,14 +1,14 @@
 =head1 TITLE
 
-P6Regex - compiler and parser for Perl 6 regex
+Perl6Regex - compiler and parser for Perl 6 regex
 
 =over 4
 
-=item C<compile_p6regex(PMC source, PMC adverbs :slurpy :named)>
+=item C<compile_perl6regex(PMC source, PMC adverbs :slurpy :named)>
 
 Return the result of compiling C<source> according to Perl 6
 regex syntax and the associated C<adverbs>.  Normally this
-function is obtained using C<compreg 'PGE::P6Regex'> instead
+function is obtained using C<compreg 'PGE::Perl6Regex'> instead
 of calling it directly.
 
 Returns the compiled regular expression.  If a C<target>
@@ -18,9 +18,9 @@
 
 =cut
 
-.namespace [ 'PGE::P6Regex' ]
+.namespace [ 'PGE::Perl6Regex' ]
 
-.sub 'compile_p6regex'
+.sub 'compile_perl6regex'
     .param pmc source
     .param pmc args            :slurpy
     .param pmc adverbs         :slurpy :named
@@ -91,7 +91,7 @@
 
   parse:
     ##   Let's parse the source as a regex
-    $P0 = get_hll_global ['PGE::Grammar'], 'regex'
+    $P0 = get_global 'regex'
     match = $P0(source, adverbs :flat :named)
     if target != 'parse' goto check
     .return (match)
@@ -111,7 +111,7 @@
     pad = clone adverbs
     $P0 = new .Hash
     pad['lexscope'] = $P0
-    exp = exp.'p6exp'(pad)
+    exp = exp.'perl6exp'(pad)
 
     .return exp.'compile'(adverbs :flat :named)
 .end
@@ -120,14 +120,10 @@
 =item C<regex(PMC mob, PMC adverbs :slurpy :named)>
 
 Parses a regex according to Perl 6 regex syntax, and returns 
-the corresponding parse tree.  This is installed as a C<< <regex> >> 
-rule in C<PGE::Grammar>, so one can call it from another regex to 
-parse valid Perl 6 regular expressions.
+the corresponding parse tree.  
 
 =cut
 
-.namespace [ 'PGE::Grammar' ]
-
 .sub 'regex'
     .param pmc mob
     .param pmc adverbs         :slurpy :named
@@ -135,8 +131,8 @@
     .local string stop
     .local pmc stopstack, optable, match
 
-    stopstack = get_hll_global ['PGE::P6Regex'], '@!stopstack'
-    optable = get_hll_global ['PGE::P6Regex'], '$optable'
+    stopstack = get_global '@!stopstack'
+    optable = get_global '$optable'
 
     stop = adverbs['stop']
     push stopstack, stop
@@ -148,14 +144,14 @@
 
 =item C<onload()>
 
-Initializes the P6Regex parser and other data structures
+Initializes the Perl6Regex parser and other data structures
 needed for compiling regexes.
 
 =cut
 
 .include 'cclass.pasm'
 
-.namespace [ 'PGE::P6Regex' ]
+.namespace [ 'PGE::Perl6Regex' ]
 
 .sub '__onload' :load
     .local pmc optable
@@ -204,7 +200,7 @@
     optable.newtok('term:<![', 'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
 
     $P0 = get_global 'parse_quoted_literal'
-    optable.newtok("term:<'",  'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
+    optable.newtok("term:'",  'equiv'=>'term:', 'nows'=>1, 'parsed'=>$P0)
 
     optable.newtok('term:::',  'equiv'=>'term:', 'nows'=>1, 
'match'=>'PGE::Exp::Cut')
     optable.newtok('term::::', 'equiv'=>'term:', 'nows'=>1, 
'match'=>'PGE::Exp::Cut')
@@ -254,16 +250,16 @@
 
     # Create and store closure preprocessors in %closure_pp
     $P0 = new .Hash
-    set_hll_global ['PGE::P6Regex'], '%closure_pp', $P0
-    $P1 = get_hll_global ['PGE::P6Regex'], 'PIR_closure'
+    set_hll_global ['PGE::Perl6Regex'], '%closure_pp', $P0
+    $P1 = get_hll_global ['PGE::Perl6Regex'], 'PIR_closure'
     $P0["PIR"] = $P1
 
     # Create an array for holding stop tokens
     $P0 = new .ResizablePMCArray
-    set_hll_global ['PGE::P6Regex'], '@!stopstack', $P0
+    set_hll_global ['PGE::Perl6Regex'], '@!stopstack', $P0
 
-    $P0 = get_global 'compile_p6regex'
-    compreg 'PGE::P6Regex', $P0
+    $P0 = get_global 'compile_perl6regex'
+    compreg 'PGE::Perl6Regex', $P0
     .return ()
 .end
 
@@ -288,7 +284,7 @@
     lastpos = length target
 
     .local string stop
-    $P0 = get_hll_global ['PGE::P6Regex'], '@!stopstack'
+    $P0 = get_hll_global ['PGE::Perl6Regex'], '@!stopstack'
     stop = $P0[-1]
 
     .local string initchar
@@ -717,7 +713,7 @@
     inc pos
     mpos = pos
     .local pmc regex
-    regex = get_hll_global ['PGE::Grammar'], 'regex'
+    regex = get_global 'regex'
     $P1 = regex(mob, 'stop'=>'>')
     unless $P1 goto end
     $S0 = $P1
@@ -909,7 +905,7 @@
     parse_error(mob, pos, "Error parsing enumerated character class")
     goto end
   err_hyphen:
-    parse_error(mob, pos, "Unescaped '-' in charlist (use '..' or '\-')")
+    parse_error(mob, pos, "Unescaped '-' in charlist (use '..' or '\\-')")
     goto end
   err_close:
     parse_error(mob, pos, "Missing close '>' or ']>' in enumerated character 
class")
@@ -920,7 +916,7 @@
 
 =item C<parse_quoted_literal>
 
-Parses <'...'> literals.
+Parses '...' literals.
 
 =cut
 
@@ -930,14 +926,13 @@
     .local string target
     (mob, target, pos) = mob.newfrom(0, 'PGE::Exp::Literal')
     lastpos = length target
-    lastpos -= 2
+    lastpos -= 1
     .local string lit
     lit = ''
   literal_iter:
     if pos > lastpos goto literal_error
-    $S0 = substr target, pos, 2
-    if $S0 == "'>" goto literal_end
     $S0 = substr target, pos, 1
+    if $S0 == "'" goto literal_end
     if $S0 != "\\" goto literal_add
     inc pos
     $S0 = substr target, pos, 1
@@ -946,12 +941,12 @@
     lit .= $S0
     goto literal_iter
   literal_end:
-    pos += 2
+    inc pos
     mob.'result_object'(lit)
     mob.'to'(pos)
     .return (mob)
   literal_error:
-    parse_error(mob, pos, "No closing '> in quoted literal")
+    parse_error(mob, pos, "No closing ' in quoted literal")
     .return (mob)
 .end
 
@@ -1039,7 +1034,7 @@
     $P0 = getattribute mob, '$.pos'
     $P0 = pos
     $P0 = new .Exception
-    $S0 = 'p6rule parse error: '
+    $S0 = 'perl6regex parse error: '
     $S0 .= message
     $S0 .= ' at offset '
     $S1 = pos
@@ -1060,7 +1055,7 @@
 
 .namespace [ 'PGE::Exp' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     .return (self)
 .end
@@ -1068,7 +1063,7 @@
 
 .namespace [ 'PGE::Exp::Literal' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     $I0 = pad['ignorecase']
     self['ignorecase'] = $I0
@@ -1078,7 +1073,7 @@
 
 .namespace [ 'PGE::Exp::Concat' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
 
     .local pmc array, exp
@@ -1091,7 +1086,7 @@
     if i >= n goto iter_end
     exp = self[i]
     inc i
-    exp = exp.p6exp(pad)
+    exp = exp.'perl6exp'(pad)
     if null exp goto iter_loop
     self[j] = exp
     inc j
@@ -1108,7 +1103,7 @@
 
 .namespace [ 'PGE::Exp::Quant' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
 
     $I0 = exists self['backtrack']
@@ -1125,7 +1120,7 @@
     pad['isarray'] = 1
     exp0 = self[0]
     exp0['isquant'] = 1
-    exp0 = exp0.p6exp(pad)
+    exp0 = exp0.'perl6exp'(pad)
     self[0] = exp0
     pad['isarray'] = isarray
     .return (self)
@@ -1134,7 +1129,7 @@
 
 .namespace [ 'PGE::Exp::Group' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     .local pmc exp0
 
@@ -1148,7 +1143,7 @@
   backtrack_done:
 
     exp0 = self[0]
-    exp0 = exp0.p6exp(pad)
+    exp0 = exp0.'perl6exp'(pad)
     self[0] = exp0
     .return (self)
 .end
@@ -1156,7 +1151,7 @@
 
 .namespace [ 'PGE::Exp::CGroup' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     .local pmc exp
 
@@ -1217,7 +1212,7 @@
     $P0 = new .Hash
     pad['lexscope'] = $P0
     exp = self[0]
-    exp = exp.'p6exp'(pad)
+    exp = exp.'perl6exp'(pad)
     self[0] = exp
     pad['lexscope'] = lexscope
     pad['isarray'] = padarray
@@ -1226,7 +1221,7 @@
 
   unscoped:
     exp = self[0]
-    exp = exp.'p6exp'(pad)
+    exp = exp.'perl6exp'(pad)
     self[0] = exp
   end:
     .return (self)
@@ -1235,7 +1230,7 @@
 
 .namespace [ 'PGE::Exp::Subrule' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
 
     $I0 = self['isquant']
@@ -1276,7 +1271,7 @@
 
 .namespace [ 'PGE::Exp::WS' ]
 
-.sub 'p6exp' :method 
+.sub 'perl6exp' :method 
     .param pmc pad
 
     $I0 = pad['sigspace']
@@ -1292,7 +1287,7 @@
 
 .namespace [ 'PGE::Exp::Alt' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
 
     .local pmc exp0, exp1
@@ -1303,14 +1298,14 @@
     ##   reduce and return it.
     $I0 = defined self[1]
     if $I0 goto with_rhs
-    .return exp0.'p6exp'(pad)
+    .return exp0.'perl6exp'(pad)
   with_rhs:
 
     ##   if lhs is whitespace, then this is a prefix-alt and
     ##   we ignore it (by simply returning its rhs)
     $I0 = isa exp0, 'PGE::Exp::WS'
     if $I0 == 0 goto with_lhs
-    .return exp1.'p6exp'(pad)
+    .return exp1.'perl6exp'(pad)
   with_lhs:
 
     .local pmc lexscope, savescope, iter
@@ -1325,13 +1320,13 @@
     goto iter_loop
   iter_end:
     $I0 = pad['subpats']
-    exp0 = exp0.p6exp(pad)
+    exp0 = exp0.'perl6exp'(pad)
     self[0] = exp0
 
     $I1 = pad['subpats']
     pad['subpats'] = $I0
     pad['lexscope'] = savescope
-    exp1 = exp1.'p6exp'(pad)
+    exp1 = exp1.'perl6exp'(pad)
     self[1] = exp1
     $I0 = pad['subpats']
     if $I0 >= $I1 goto end
@@ -1343,7 +1338,7 @@
 
 .namespace [ 'PGE::Exp::Alias' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     .local string cname
     .local pmc exp0, exp1
@@ -1380,21 +1375,21 @@
     cexp['isscope'] = 0
     cexp['iscapture'] = 1
     cexp['cname'] = cname
-    cexp = cexp.p6exp(pad)
+    cexp = cexp.'perl6exp'(pad)
     .return (cexp)
 
   make_alias:
     exp1['cname'] = cname
     exp1['iscapture'] = 1
   end:
-    exp1 = exp1.p6exp(pad)
+    exp1 = exp1.'perl6exp'(pad)
     .return (exp1)
 .end
 
 
 .namespace [ 'PGE::Exp::Modifier' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     .local string key
     .local string value
@@ -1415,7 +1410,7 @@
     pad[key] = value
     .local pmc exp
     exp = self[0]
-    exp = exp.p6exp(pad)
+    exp = exp.'perl6exp'(pad)
     self[0] = exp
     pad[key] = $P0
     .return (exp)
@@ -1423,13 +1418,13 @@
 
 .namespace [ 'PGE::Exp::Conj' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     $P0 = self[0]
-    $P0 = $P0.p6exp(pad)
+    $P0 = $P0.'perl6exp'(pad)
     self[0] = $P0
     $P1 = self[1]
-    $P1 = $P1.p6exp(pad)
+    $P1 = $P1.'perl6exp'(pad)
     self[1] = $P1
     .return (self)
 .end
@@ -1437,7 +1432,7 @@
 
 .namespace [ 'PGE::Exp::Closure' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     .local string lang
     .local pmc closure_pp
@@ -1445,7 +1440,7 @@
     lang = pad['lang']
     self['lang'] = lang
     # see if we need to do any pre-processing of the closure
-    closure_pp = get_hll_global ['PGE::P6Regex'], '%closure_pp'
+    closure_pp = get_hll_global ['PGE::Perl6Regex'], '%closure_pp'
     $I0 = defined closure_pp[lang]
     if $I0 == 0 goto end
     closure_fn = closure_pp[lang]
@@ -1471,7 +1466,7 @@
 =back
 =cut
 
-.namespace [ 'PGE::P6Regex' ]
+.namespace [ 'PGE::Perl6Regex' ]
 
 .sub 'PIR_closure'
     .param string code
@@ -1486,7 +1481,7 @@
 
 .namespace [ 'PGE::Exp::Cut' ]
 
-.sub 'p6exp' :method
+.sub 'perl6exp' :method
     .param pmc pad
     $S0 = self
     if $S0 == ':::' goto cut_rule

Modified: trunk/config/gen/makefiles/pge.in
==============================================================================
--- trunk/config/gen/makefiles/pge.in   (original)
+++ trunk/config/gen/makefiles/pge.in   Tue Apr  3 19:36:12 2007
@@ -31,6 +31,7 @@
   PGE/Match.pir \
   PGE/Regex.pir \
   PGE/P6Regex.pir \
+  PGE/Perl6Regex.pir \
   PGE/OPTable.pir \
   PGE/P5Regex.pir \
   PGE/builtins.pg \

Copied: trunk/t/compilers/pge/perl6regex/01-regex.t (from r17964, 
/trunk/t/compilers/pge/p6regex/01-regex.t)
==============================================================================
--- /trunk/t/compilers/pge/p6regex/01-regex.t   (original)
+++ trunk/t/compilers/pge/perl6regex/01-regex.t Tue Apr  3 19:36:12 2007
@@ -4,7 +4,7 @@
 
 =head1 NAME
 
-t/compilers/pge/p6regex/01-regex.t  -- Basic P6 Regex tests
+t/compilers/pge/perl6regex/01-regex.t  -- Basic Perl6Regex tests
 
 =head1 DESCRIPTION
 
@@ -64,26 +64,20 @@
     .local pmc test       # the test harness object.
                test = new 'Test::Builder'
 
-    .local pmc todo_tests # keys indicate test file; values test number.
-               todo_tests = new 'Hash'
-
-    .local pmc skip_tests # keys indicate tests ID; values reasons.
-               skip_tests = new 'Hash'
-
     .local string test_dir # the directory containing tests
-                  test_dir = 't/compilers/pge/p6regex/'
+                  test_dir = 't/compilers/pge/perl6regex/'
 
     .local pmc test_files # values are test file names to run.
                test_files = new 'ResizablePMCArray'
 
     # populate the list of test files
-    push test_files, 'rx_metachars'
+    # push test_files, 'rx_metachars'
     push test_files, 'rx_backtrack'
     push test_files, 'rx_charclass'
-    push test_files, 'rx_subrules'
-    push test_files, 'rx_lookarounds'
-    push test_files, 'rx_captures'
-    push test_files, 'rx_modifiers'
+    # push test_files, 'rx_subrules'
+    # push test_files, 'rx_lookarounds'
+    # push test_files, 'rx_captures'
+    # push test_files, 'rx_modifiers'
 
     .local pmc interp     # a handle to our interpreter object.
                interp = getinterp
@@ -107,6 +101,9 @@
     .local int ok            # is this a passing test?
 
     # for any given test:
+    .local int skiptest       # if the test is '# skip'
+    .local int todotest       # if the test is '# todo'
+    .local string reason      # reason for todo/skip
     .local pmc rule           # the rule
     .local pmc match          # the match
     .local string pattern     # the regexp
@@ -114,9 +111,6 @@
     .local string result      # expected result of this test. (y/n/...)
     .local string description # user-facing description of the test.
 
-    todo_tests = 'set_todo_info'()
-    skip_tests = 'set_skip_info'()
-
     # how many tests to run?
     # XXX: this should be summed automatically from test_files data
     #      until then, it's set to no plan
@@ -131,6 +125,10 @@
     .local int local_test_number
                local_test_number = 0
 
+    # local line number in test file
+    .local int local_line_number
+               local_line_number = 0
+
     # append the test directory and filename
     test_file = test_dir . test_name
 
@@ -139,15 +137,41 @@
     $S0 = typeof file_handle
     if $S0 == 'Undef' goto bad_file
 
-    # loop over the file, one at a time.
+  next_test:
+    skiptest = 0
+    todotest = 0
 
+    # loop over the file, one at a time.
   loop:
     # read in the file one line at a time...
     $I0 = file_handle.'eof'()
     if $I0 goto end_loop
 
     test_line = readline file_handle
+    inc local_line_number
 
+    # if this line is not a comment, try a test
+    $S0 = substr test_line, 0, 1
+    if $S0 != '#' goto parse_test
+
+  parse_comment:
+    # line is a comment, if no :pge<...> then skip comment
+    $I0 = index test_line, ':pge<'
+    if $I0 == -1 goto loop
+
+    # extract out the reason for skip or todo
+    $I0 += 5
+    $I1 = index test_line, '>', $I0
+    $I1 -= $I0
+    reason = substr test_line, $I0, $I1
+
+    # determine skip/todo
+    $S0 = substr test_line, 0, 7
+    skiptest = iseq $S0, '# skip '
+    todotest = iseq $S0, '# todo '
+    goto loop
+
+  parse_test:
     # skip lines without tabs
     $I0 = index test_line, "\t"
     if $I0 == -1 goto loop
@@ -160,7 +184,7 @@
     clear_eh
 
     # prepend test filename and line number to description
-    description = 'build_test_desc'( description, test_name, local_test_number 
)
+    description = 'build_test_desc'( description, test_name, local_line_number 
)
 
     if target != "''" goto got_target
     target = ''
@@ -170,17 +194,13 @@
     result = 'backslash_escape'( result )
 
     # Should this test be skipped?
-    $I0 = exists skip_tests[test_name]
-    unless $I0 goto not_skip
-    $P0 = skip_tests[test_name]
-    $I0 = exists $P0[local_test_number]
-    unless $I0 goto not_skip
-    test.'skip'(1, description)
-    goto loop
+    unless skiptest goto not_skip
+    test.'skip'(1, reason)
+    goto next_test
 
   not_skip:
     push_eh thrown
-    match = 'match_p6regex'( pattern, target )
+    match = 'match_perl6regex'( pattern, target )
     clear_eh
 
     if match goto matched
@@ -214,17 +234,13 @@
     ok = 0
 
   emit_test:
-    $I0 = exists todo_tests[test_name]
-    unless $I0 goto not_todo
-    $P0 = todo_tests[test_name]
-    $I0 = exists $P0[local_test_number]
-    unless $I0 goto not_todo
-    test.'todo'(ok,description)
-    goto loop
+    unless todotest goto not_todo
+    test.'todo'(ok, description, reason)
+    goto next_test
   not_todo:
-    test.'ok'(ok,description)
+    test.'ok'(ok, description)
+    goto next_test
 
-    goto loop
   end_loop:
     close file_handle
     goto outer_loop
@@ -242,6 +258,7 @@
     .sym pmc exception
     .sym string message
     get_results '(0,0)', exception, message
+    say message
     # remove /'s
     $S0 = substr result, 0, 1
     if $S0 != "/" goto bad_error
@@ -265,119 +282,6 @@
 .end
 
 
-# set todo information
-.sub 'set_todo_info'
-    .local pmc todo_tests # keys indicate test file; values test number
-               todo_tests = new 'Hash'
-
-    .local pmc todo_info
-               todo_info = new 'Hash'
-
-    .local string test_file
-
-    test_file = 'rx_metachars'
-    bsr reset_todo_info
-    todo_info[78]  = 1
-    todo_info[79]  = 1
-    todo_info[81]  = 1
-    todo_info[91]  = 1
-    todo_info[92]  = 1
-    todo_info[94]  = 1
-    todo_info[95]  = 1
-    todo_info[96]  = 1
-    todo_info[101] = 1
-    todo_info[103] = 1
-    todo_info[105] = 1
-    todo_info[113] = 1
-    todo_info[114] = 1
-    todo_info[115] = 1
-    todo_info[116] = 1
-    todo_info[119] = 1
-    todo_info[120] = 1
-    todo_info[121] = 1
-    todo_tests[test_file] = todo_info
-
-    test_file = 'rx_charclass'
-    bsr reset_todo_info
-    todo_info[17] = 1
-    todo_tests[test_file] = todo_info
-
-    test_file = 'rx_subrules'
-    bsr reset_todo_info
-    todo_info[29] = 1
-    todo_info[30] = 1
-    todo_info[31] = 1
-    todo_info[40] = 1
-    todo_tests[test_file] = todo_info
-
-    test_file = 'rx_captures'
-    bsr reset_todo_info
-    todo_info[14] = 1
-    todo_info[15] = 1
-    todo_info[16] = 1
-    todo_info[38] = 1
-    todo_info[39] = 1
-    todo_info[40] = 1
-    todo_tests[test_file] = todo_info
-
-    test_file = 'rx_modifiers'
-    bsr reset_todo_info
-    todo_info[86] = 1
-    todo_info[91] = 1
-    todo_info[96] = 1
-    todo_info[97] = 1
-    todo_tests[test_file] = todo_info
-    .return (todo_tests)
-
-  reset_todo_info:
-    todo_info = new .Hash
-    ret
-
-  set_todo_loop:
-    if $I0 > $I1 goto end_loop
-    todo_info[$I0] = 1
-    $I0 += 1
-    goto set_todo_loop
-  end_loop:
-    ret
-.end
-
-
-# set skip information
-.sub 'set_skip_info'
-    .local pmc skip_tests # keys indicate test file; values test number
-               skip_tests = new 'Hash'
-
-    .local pmc skip_info
-               skip_info = new 'Hash'
-
-    .local string test_file
-
-    # test_file = 'rx_metachars'
-    # bsr reset_skip_info
-    # skip_info[121] = 'no ICU'
-    # skip_tests[test_file] = skip_info
-
-    .return (skip_tests)
-
-  reset_skip_info:
-    skip_info = new .Hash
-    ret
-
-  set_skip_loop:
-    if $I0 > $I1 goto end_loop
-    if $S0 != '' goto set_skip_info
-    $S0 = 'unknown reason'
-  set_skip_info:
-    skip_info[$I0] = $S0
-    $I0 += 1
-    goto set_skip_loop
-  end_loop:
-    $S0 = ''
-    ret
-.end
-
-
 .sub 'parse_data'
     .param string test_line   # the data record
 
@@ -445,14 +349,14 @@
 .end
 
 
-.sub 'match_p6regex'
+.sub 'match_perl6regex'
     .param string pattern
     .param string target
 
     .local pmc match
 
     .local pmc p6rule     # the perl6 regex compiler
-               p6rule = compreg 'PGE::P6Regex'
+               p6rule = compreg 'PGE::Perl6Regex'
 
     .local pmc rule
                rule = p6rule(pattern)

Copied: trunk/t/compilers/pge/perl6regex/rx_charclass (from r17964, 
/trunk/t/compilers/pge/p6regex/rx_charclass)
==============================================================================
--- /trunk/t/compilers/pge/p6regex/rx_charclass (original)
+++ trunk/t/compilers/pge/perl6regex/rx_charclass       Tue Apr  3 19:36:12 2007
@@ -14,6 +14,7 @@
 <[b..d]>               axxxef          n       character range
 <-[b..d]>              abcdef          y       negated character range
 <-[b..d]>              bbccdd          n       negated character range
+# todo :pge<reversed character range>
 <-[d..b]>              bbccdd          n       negated (illegal) character 
range
 <[-]>                  ab-def          /parse error/   unescaped hyphen
 <[\-]>                 ab-def          y       escaped hyphen
@@ -39,14 +40,14 @@
 ^<[<>]>**{2}           ><              y       lt, gt  character class
 ^<-[><]>               ><              n       not gt, lt character class
 ^<-[<>]>               ><              n       not lt, gt  character class
-<'... --- ...'>                ... --- ...     y       literal match (\')
-<'... --- ...'>                ...---...       n       literal match (\')
-<'ab\'>cd'>            ab'>cd          y       literal match with quote
-<'ab\\cd'>             ab\x5ccd        y       literal match with backslash
-<'?'>          ab<?    y       literal match with question mark
-<'<'>          ab<?    y       literal match with lt 
-<'<?'>         ab<?    y       literal match with lt and question mark
-<'<?'>         ab<x?   n       non-matching literal match with lt and question 
mark
+'... --- ...'          ... --- ...     y       literal match (\')
+'... --- ...'          ...---...       n       literal match (\')
+'ab\'>cd'              ab'>cd          y       literal match with quote
+'ab\\cd'               ab\x5ccd        y       literal match with backslash
+'?'            ab<?    y       literal match with question mark
+'<'            ab<?    y       literal match with lt 
+'<?'           ab<?    y       literal match with lt and question mark
+'<?'           ab<x?   n       non-matching literal match with lt and question 
mark
 <[A..Z0..9]>           abcdef          n       two enumerated ranges
 <[A..Z0..9]>           abcDef          y       two enumerated ranges
 

Modified: trunk/t/compilers/pge/pge.t
==============================================================================
--- trunk/t/compilers/pge/pge.t (original)
+++ trunk/t/compilers/pge/pge.t Tue Apr  3 19:36:12 2007
@@ -93,7 +93,7 @@
 OUT
 
 ## compiler registration
-for my $compiler (qw/ PGE::P6Regex PGE::P5Regex PGE::Glob /) {
+for my $compiler (qw/ PGE::Perl6Regex PGE::P6Regex PGE::P5Regex PGE::Glob /) {
     pir_output_is( <<"CODE". $POST, <<OUT, 'compreg "$compiler"' );
 .sub 'main' :main
         load_bytecode 'PGE.pbc'

Reply via email to