-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add TokenSet.numSet/toString and tokenRepr in jsctrl (#76)
This PR adds support for `TokenSet.numSet/toString` and `tokenRepr` in `jsctrl`. Example: ```js // samples/hello.js async function main() { await $`Ultimate answer is to the life, universe and everything is ` await gen({ regex: /abc^/ }) } start(main) ``` Output: ``` % ../../aici.sh run --build . samples/hello.js ... [0]: FIXED "Ultimate answer is to the life, universe and everything is " [0]: GEN-OPT {regex: /abc^/} [0]: regex constraint: "abc^" [0]: dfa: 244 bytes [0]: ALLOW: TokenSet: 3/50295; "a", "ab", "abc" [0]: GEN-STEP: "a" [0]: ALLOW: TokenSet: 2/50295; "b", "bc" [0]: GEN-STEP: "b" [0]: ALLOW: TokenSet: 1/50295; "c" [0]: GEN-STEP: "c" [0]: ALLOW: TokenSet: 0/50295; [0]: Constraint doesn't allow any tokens; adding EOS [0]: GEN-STEP: EOS [0]: GEN "abc" [0]: JsCtrl: done [DONE] [Response] abc ``` Closes #64
- Loading branch information
1 parent
5a83316
commit c662637
Showing
4 changed files
with
48 additions
and
2 deletions.
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
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