Last active
December 17, 2021 06:03
-
-
Save francisrstokes/fb0f0564c4e16a73e7e3ca80e8399c3a to your computer and use it in GitHub Desktop.
Arcsecond Article
This file contains hidden or 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
const { parse, char, str, sequenceOf, choice } = require('arcsecond'); | |
// parse creates a function we can use for parsing text | |
const parseText = parse (combinedParser); | |
console.log( | |
parseText ('hello world') | |
) | |
// -> [ 'hello', ' ', 'world' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Gist is embedded in the Arcsecond HackerNoon article. I think this example is missing the part where
combineParser
is defined (it's not defined, and none of the arcsecond commands are used!)edit: actually - I guess the contents is supposed to be elided in this example, but the issue is the previous example is cropped:

I tried it in a couple of browsers - I think the code is there, but not visible.