Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
Sven Slootweg 9ddff7120c Initial commit; v1.0.0 pirms 7 gadiem
src Initial commit; v1.0.0 pirms 7 gadiem
.gitignore Initial commit; v1.0.0 pirms 7 gadiem
.npmignore Initial commit; v1.0.0 pirms 7 gadiem
README.md Initial commit; v1.0.0 pirms 7 gadiem
gulpfile.js Initial commit; v1.0.0 pirms 7 gadiem
index.js Initial commit; v1.0.0 pirms 7 gadiem
package.json Initial commit; v1.0.0 pirms 7 gadiem
screenshot.png Initial commit; v1.0.0 pirms 7 gadiem

README.md

better-peg-tracer

A better terminal-based tracer for debugging PEG.js. Better documentation coming soon.

Screenshot of better-peg-tracer on a terminal

License

WTFPL or CC0, whichever you prefer. A donation and/or attribution are appreciated, but not required.

Donate

Maintaining open-source projects takes a lot of time, and the more donations I receive, the more time I can dedicate to open-source. If this module is useful to you, consider making a donation!

You can donate using Bitcoin, PayPal, Flattr, cash-in-mail, SEPA transfers, and pretty much anything else. Thank you!

Contributing

Pull requests welcome. Please make sure your modifications are in line with the overall code style, and ensure that you're editing the files in src/, not those in lib/.

Build tool of choice is gulp; simply run gulp while developing, and it will watch for changes.

Be aware that by making a pull request, you agree to release your modifications under the licenses stated above.

Usage

const pegjs = require("pegjs");
const createBetterPegTracer = require("better-peg-tracer");

let stringToParse = `
foo{{{}}
{{align:center}bar
qux {class:test1,test2}baz{/class}{/align}}
`.trim();

let parser = pegjs.buildParser(pegGrammar, {
	trace: true
});

let results = parser.parse(stringToParse, {
	tracer: createBetterPegTracer(stringToParse)
});

API

createBetterPegTracer(inputString)

Creates a tracer for the specified inputString.

  • inputString: The string that is going to be parsed. This is necessary for snippet display to work.