Skip to content

Instantly share code, notes, and snippets.

@francisrstokes
Last active December 17, 2021 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save francisrstokes/fb0f0564c4e16a73e7e3ca80e8399c3a to your computer and use it in GitHub Desktop.
Save francisrstokes/fb0f0564c4e16a73e7e3ca80e8399c3a to your computer and use it in GitHub Desktop.
Arcsecond Article
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' ]
@mrspeaker
Copy link

mrspeaker commented Dec 17, 2021

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:
Screenshot 2021-12-17 at 13-52-48 Arcsecond Parsing in JavaScript made easy Hacker Noon

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment