How to use the wikipeg.compiler function in wikipeg

To help you get started, we’ve selected a few wikipeg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikimedia / parsoid / lib / wt2html / tokenizer.js View on Github external
PegTokenizer.prototype.compileTokenizer = function(ast, compileOpts = {}) {
	var compiler = PEG.compiler;
	var env = this.env;

	// Don't report infinite loops, i.e. repeated subexpressions which
	// can match the empty string, since our grammar gives several false
	// positives (or perhaps true positives).
	var passes = {
		check: [
			compiler.passes.check.reportMissingRules,
			compiler.passes.check.reportLeftRecursion,
		],
		transform: [
			compiler.passes.transform.analyzeParams,
		],
		generate: [
			compiler.passes.generate.astToCode
		],

wikipeg

Parser generator for JavaScript and PHP

MIT
Latest version published 8 months ago

Package Health Score

59 / 100
Full package analysis

Similar packages