Permalink
Browse files

Fix ** state funkiness, add tests

  • Loading branch information...
1 parent 6944409 commit e7236a44d5b0b2477f02af0f30d90cab4d2d6bd8 @sorear committed Dec 14, 2011
Showing with 26 additions and 12 deletions.
  1. +9 −12 docs/TODO.S05
  2. +6 −0 lib/Cursor.cs
  3. +11 −0 test2.pl
View
@@ -2,29 +2,26 @@
All line numbers are relative to c4882a67. Also, deliberate discrepencies.)
( 49) Tiebreaker #5: I still don't know what this means. (2609 conflicts)
-( 113) Unicode defines a 'Word' to include all Pc as well.
+ DISCUSS
+( 113) Unicode defines a 'Word' to include all Pc as well. DISCUSS
( 219) Loose matches are mostly not implemented.
( 226) Also no :samecase, :sameaccent, :samespace.
( 346) Need to audit whitespace removal algorithm.
( 360) No :sigspace<rule>.
( 396) No ms// or ss///; "mm" is parsed
( 408) No Unicode levels
-( 427) No :Perl5
+( 427) No :Perl5 DISCUSS
( 497) No :ex/:ov
( 535) No :rw
( 768) No internal smartmatches
( 924) $/ is a Cursor inside closures
( 933) Don't know how fail is supposed to work there
-( 945) No handling of sigspace for general quantifier
( 978) No negative quantifiers
-( 993) x* % y, etc do not seem to work
-(1039) No %% (ticket #80)
-(1057) No special handling of zero-width matches
-(1068) No % sigspace handling
+(1057) No special handling of zero-width matches DISCUSS
(1124) 'Regex' scalar values not called (ticket #77)
(1172) No auto-declared temporary variables $x = <.ident>
(1178) No bindings to existing variables
-(1186) No interpolation of arrays or || @array
+(1186) No interpolation of arrays or || @array DISCUSS PARSE
(1253) No handling of formal parameters in LTM
(1258) No {*} and funky proto handling in general
(1276) Declarativeness of constants is insufficiently general
@@ -37,22 +34,22 @@ All line numbers are relative to c4882a67. Also, deliberate discrepencies.)
(1520) No <@foo>
(1533) <{ }> has wrong semantics
(1565) Code assertions not always considered declarative
-(1585) <[ z..a ]> not treated as compile error
+(1585) <[ z..a ]> not treated as compile error DISCUSS
(1634) No Unicode properties
(1679) No <.>
(1718) No <?same>, <?at($pos)>
(1733) <?after> is incomplete
(1744) No <*...>
-(1804) No <~~>
+(1804) No <~~> DISCUSS
(1843) No <|g> etc
(1857) No <( or )>
(1893) Missing predefined rules include upper, lower, digit, xdigit, print,
graph, cntrl, punct, alnum, wb, ww, space, blank
(2246) regex :ratchet syntax doesn't work
(2342) ::> is defined in terms of brackets, not temporal alternation
(2380) No <commit> or <cut>
-(2460) $foo ~~ rule { } does not automatically dual-anchor (what!?)
-(2501) No <prior> (probable fossil)
+(2460) $foo ~~ rule { } does not automatically dual-anchor (DISCUSS)
+(2501) No <prior> (probable fossil) DISCUSS
(2638) ** 1..5 is not considered declarative
(2738) No success value; failed matches return Match
(2788) $/.ast doesn't correctly return undefined
View
@@ -75,6 +75,11 @@ public sealed class NState {
next = proto; this.cut_to = cut_to; this.name = name;
if (proto != null) klass = proto.klass;
}
+
+ public NState(NState f) {
+ next = f.next; name = f.name; cut_to = f.cut_to;
+ quant = f.quant; klass = f.klass;
+ }
}
public sealed class CapInfo {
@@ -537,6 +542,7 @@ public sealed class RxFrame: IFreeze {
}
public void IncQuant() {
+ st.ns = new NState(st.ns);
st.ns.quant++;
}
View
@@ -2,6 +2,17 @@
use Test;
use MONKEY_TYPING;
+is (("ab" x 10) ~~ /[aba?] ** 10/).chars, 20, "**COUNT works with backtracking";
+
+is ("a, d" ~~ /:s <alpha>+ % ','/), 'a, d', 'sigspace respected on %';
+is ("a b c" ~~ /:s <alpha> ** 3/), 'a b c', 'sigspace respected on **';
+is ("a, d" ~~ /:s <alpha>+%','/), 'a', 'no-sigspace respected on %';
+is ("a b c def" ~~ /:s <alpha>**3/), ' def', 'no-sigspace respected on **';
+is ("a,b,c," ~~ / <alpha>+ %% ','/), 'a,b,c,', '%% works';
+is ("a,b,c" ~~ / <alpha>+ %% ','/), 'a,b,c', '%% works like %';
+is ("a,b,c" ~~ / <alpha>* %% ','/), 'a,b,c', '% works on *';
+is ("XX" ~~ / X <alpha>* %% ',' X/), 'XX', '% works on * (null string)';
+
{
my class Bt {
has $!pie;

0 comments on commit e7236a4

Please sign in to comment.