Browse Source

Remove grammar option for Session API

master
Futago-za Ryuu 5 years ago
parent
commit
f4ca7ca461
  1. 1
      docs/guides/javascript-api.md
  2. 1
      lib/compiler/session.js
  3. 1
      lib/peg.js
  4. 1
      lib/typings/api.d.ts

1
docs/guides/javascript-api.md

@ -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.

1
lib/compiler/session.js

@ -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 || {};

1
lib/peg.js

@ -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 )
} );

1
lib/typings/api.d.ts

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

Loading…
Cancel
Save