-
Notifications
You must be signed in to change notification settings - Fork 17
feat(parse): spruce up this package to make it useful #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ef31500 to
1b45c53
Compare
| /** | ||
| * Justin parser template tag. | ||
| */ | ||
| export const justin = makeJustin(peg.extends(json)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok... I got this to work in the case of:
justin`make(BLD, BigInt(100))`My first attempt was:
justin`make(BLD, 100n)`The diagnostic was pretty misleading: quasiRest is not a function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this error. Now it returns the diagnostic I was expecting:
justin`make(BLD, 100n)`
-------template--------
"make(BLD, 100n)"
-------
looking for digit, frac, exp, _WSN
Syntax error at 13 "n" #0:13
and I added support for bigint literals, so now you should get:
[
'call',
[ 'use', 'make', _pegPosition: '"m" #0:0' ],
[
[ 'use', 'BLD', _pegPosition: '"B" #0:5' ],
[ 'data', 100n, _pegPosition: '"1" #0:10' ],
_pegPosition: '"(" #0:4'
],
_pegPosition: '"m" #0:0'
]414d43e to
d267a77
Compare
d267a77 to
77855d5
Compare
| t.deepEqual(parse(`12345`), ast(0, 'data', 12345)); | ||
| t.deepEqual(parse(`12_345`), ast(0, 'data', 12345)); | ||
| t.deepEqual(parse('9898n'), ast(0, 'data', BigInt(9898))); | ||
| t.deepEqual(parse('98_9_8n'), ast(0, 'data', BigInt(9898))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯
|
@dckc, thanks for the reapproval! Shall I crank out a new release of |
|
a release would be nice, thanks. low priority, though |
To reduce the burden of figuring out how to use this package, add some more meaningful exports to main.js.