2014-11-26 23:24:40 +00:00
|
|
|
import parser from './javascript/grammar.peg';
|
|
|
|
|
2014-12-17 16:53:04 +00:00
|
|
|
import Node from './javascript/node.js';
|
2014-11-26 23:24:40 +00:00
|
|
|
import Root from './javascript/root.js';
|
|
|
|
import Regexp from './javascript/regexp.js';
|
2014-11-30 22:54:12 +00:00
|
|
|
import Match from './javascript/match.js';
|
2014-12-03 02:09:20 +00:00
|
|
|
import MatchFragment from './javascript/match_fragment.js';
|
2014-12-03 02:02:48 +00:00
|
|
|
import Subexp from './javascript/subexp.js';
|
|
|
|
import Charset from './javascript/charset.js';
|
2014-12-07 22:38:24 +00:00
|
|
|
import CharsetLiteral from './javascript/charset_literal.js';
|
|
|
|
import CharsetEscape from './javascript/charset_escape.js';
|
|
|
|
import CharsetRange from './javascript/charset_range.js';
|
2014-12-06 21:03:58 +00:00
|
|
|
import Literal from './javascript/literal.js';
|
|
|
|
import Escape from './javascript/escape.js';
|
|
|
|
import AnyCharacter from './javascript/any_character.js';
|
2014-12-06 17:34:00 +00:00
|
|
|
import Repeat from './javascript/repeat.js';
|
|
|
|
import RepeatAny from './javascript/repeat_any.js';
|
|
|
|
import RepeatOptional from './javascript/repeat_optional.js';
|
|
|
|
import RepeatRequired from './javascript/repeat_required.js';
|
|
|
|
import RepeatSpec from './javascript/repeat_spec.js';
|
2014-11-26 23:24:40 +00:00
|
|
|
|
2014-12-17 16:53:04 +00:00
|
|
|
parser.Parser.SyntaxNode = Node;
|
|
|
|
parser.Parser.Root = { module: Root };
|
|
|
|
parser.Parser.Regexp = { module: Regexp };
|
|
|
|
parser.Parser.Match = { module: Match };
|
|
|
|
parser.Parser.MatchFragment = { module: MatchFragment };
|
|
|
|
parser.Parser.Subexp = { module: Subexp };
|
|
|
|
parser.Parser.Charset = { module: Charset };
|
|
|
|
parser.Parser.CharsetLiteral = { module: CharsetLiteral };
|
|
|
|
parser.Parser.CharsetEscape = { module: CharsetEscape };
|
|
|
|
parser.Parser.CharsetRange = { module: CharsetRange };
|
|
|
|
parser.Parser.Literal = { module: Literal };
|
|
|
|
parser.Parser.Escape = { module: Escape };
|
|
|
|
parser.Parser.AnyCharacter = { module: AnyCharacter };
|
|
|
|
parser.Parser.Repeat = { module: Repeat };
|
|
|
|
parser.Parser.RepeatAny = { module: RepeatAny };
|
|
|
|
parser.Parser.RepeatOptional = { module: RepeatOptional };
|
|
|
|
parser.Parser.RepeatRequired = { module: RepeatRequired };
|
|
|
|
parser.Parser.RepeatSpec = { module: RepeatSpec };
|
2014-11-26 23:24:40 +00:00
|
|
|
|
2014-12-17 00:00:27 +00:00
|
|
|
parser.parse = (parse => {
|
|
|
|
return function() {
|
|
|
|
Subexp.resetCounter();
|
|
|
|
return parse.apply(this, arguments);
|
|
|
|
};
|
|
|
|
})(parser.parse);
|
2014-12-10 11:18:55 +00:00
|
|
|
|
2014-11-26 23:24:40 +00:00
|
|
|
export default parser;
|