Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var chevrotain = require("chevrotain");
// ----------------- lexer -----------------
var extendToken = chevrotain.extendToken;
var Lexer = chevrotain.Lexer;
var Parser = chevrotain.Parser;
var Assign = extendToken("Assign", /=/);
var Export = extendToken("Export", /export/);
var Interface = extendToken("Interface", /interface/);
var Identifier = extendToken("Identifier", /\w+/);
var WhiteSpace = extendToken("WhiteSpace", /\s+/);
WhiteSpace.GROUP = Lexer.SKIPPED; // marking WhiteSpace as 'SKIPPED' makes the lexer skip it.
var allTokens = [
WhiteSpace, // whitespace is normally very common so it should be placed first to speed up the lexer's performance
Assign,
Export,
Interface,
var chevrotain = require("chevrotain");
var JisonLex = require('jison-lex');
// ----------------- lexer -----------------
var Parser = chevrotain.Parser;
var extendToken = chevrotain.extendToken;
// In ES6, custom inheritance implementation (such as the one above) can be replaced with simple "class X extends Y"...
var True = extendToken("True");
var False = extendToken("False");
var Null = extendToken("Null");
var LCurly = extendToken("LCurly");
var RCurly = extendToken("RCurly");
var LSquare = extendToken("LSquare");
var RSquare = extendToken("RSquare");
var Comma = extendToken("Comma");
var Colon = extendToken("Colon");
var StringLiteral = extendToken("StringLiteral");
var NumberLiteral = extendToken("NumberLiteral");
// DOCS: this object will act as a map between the TokenClass names and their constructors.