Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[nrx] Expose basic nrx functionality to CgOp
- Loading branch information
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,31 @@ | ||
| # vim: ft=perl6 | ||
| use Test; | ||
|
|
||
| ok '{}' ~~ / \{ <.ws> \} /, 'ws matches between \W'; | ||
| #ok '{}' ~~ / \{ <.ws> \} /, 'ws matches between \W'; | ||
|
|
||
| sub rxt($C) { | ||
| Q:CgOp { | ||
| (prog | ||
| (setfield rx (callframe) (rawnew RxFrame (cast Cursor (@ {$C})))) | ||
| (rxbprim ExactOne (char x)) | ||
| (rawccall (getfield rx (callframe)) End) | ||
| (rawccall (getfield rx (callframe)) Backtrack) | ||
| (null Variable)) | ||
| } | ||
| } | ||
| PRE-INIT { | ||
| Q:CgOp { | ||
| (prog | ||
| (rawsset RxFrame.EMPTYP (@ {EMPTY})) | ||
| (rawsset RxFrame.ListMO (getfield klass (cast DynObject (@ {List})))) | ||
| (rawsset RxFrame.LLArrayMO (getfield klass | ||
| (cast DynObject (@ {LLArray})))) | ||
| (null Variable)) | ||
| } | ||
| } | ||
|
|
||
| ok rxt(Cursor.new("x")).Bool, "/x/ ~~ x"; | ||
| ok !rxt(Cursor.new("y")).Bool, "/x/ !~ y"; | ||
|
|
||
| done-testing; |