Remove grammar option for Session API

master
Futago-za Ryuu 6 years ago
parent 6d25da2d2b
commit f4ca7ca461

@ -62,7 +62,6 @@ An instance of this class holds helpers (methods, objects with methods, constant
The following option's are used by the Session API, but are currently all optional:
* `grammar` - The input that was parsed (source for the PEG.js AST passed to the compiler and the current passes).
* `opcodes` - An `enum` like hashmap (plain object) that is used by the bytecode and parser generators.
* `parser` - A pre-generated PEG.js grammar parser that should return an instance of the PEG.js AST's Grammar class. Can be replaced to add additional syntax features, or allow an alternative syntax for the grammar.
* `passes` - An object with each property being an array of methods that will check or alter the AST passed to them.

@ -24,7 +24,6 @@ class Session {
config = typeof config !== "undefined" ? config : {};
this.grammar = config.grammar;
this.opcodes = config.opcodes || opcodes;
this.parser = config.parser || parser;
this.passes = config.passes || {};

@ -31,7 +31,6 @@ const peg = {
const plugins = "plugins" in options ? options.plugins : [];
const session = new compiler.Session( {
grammar: grammar,
passes: util.convertPasses( compiler.passes )
} );

@ -438,7 +438,6 @@ declare namespace peg {
interface ISessionConfig {
[ key: string ]: any;
grammar?: string;
opcodes?: IOpcodes;
parser?: GeneratedParser<Grammar>;
passes?: IPassesMap;

Loading…
Cancel
Save