Skip to content

Commit

Permalink
Get protoregexes working.
Browse files Browse the repository at this point in the history
Transitive LTM seems to work out fine.
  • Loading branch information
jnthn committed Feb 16, 2013
1 parent b1244fb commit 3b215cd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -2245,7 +2245,19 @@ public static SixModelObject nfatostatelist(SixModelObject nfa, ThreadContext tc
throw new RuntimeException("nfatostatelist NYI");
}
public static SixModelObject nfarunproto(SixModelObject nfa, String target, long pos, ThreadContext tc) {
throw new RuntimeException("nfarunproto NYI");
/* Run the NFA. */
int[] fates = runNFA(tc, (NFAInstance)nfa, target, pos);

/* Copy results into an RIA. */
SixModelObject BOOTIntArray = tc.gc.BOOTIntArray;
SixModelObject fateRes = BOOTIntArray.st.REPR.allocate(tc, BOOTIntArray.st);
fateRes.initialize(tc);
for (int i = 0; i < fates.length; i++) {
tc.native_i = fates[i];
fateRes.bind_pos_native(tc, i);
}

return fateRes;
}
public static SixModelObject nfarunalt(SixModelObject nfa, String target, long pos,
SixModelObject bstack, SixModelObject cstack, SixModelObject marks, ThreadContext tc) {
Expand Down

0 comments on commit 3b215cd

Please sign in to comment.