[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | const Parser = require('./parser');
|
---|
| 4 | const AtWord = require('./atword');
|
---|
| 5 | const Colon = require('./colon');
|
---|
| 6 | const Comma = require('./comma');
|
---|
| 7 | const Comment = require('./comment');
|
---|
| 8 | const Func = require('./function');
|
---|
| 9 | const Num = require('./number');
|
---|
| 10 | const Operator = require('./operator');
|
---|
| 11 | const Paren = require('./paren');
|
---|
| 12 | const Str = require('./string');
|
---|
| 13 | const UnicodeRange = require('./unicode-range');
|
---|
| 14 | const Value = require('./value');
|
---|
| 15 | const Word = require('./word');
|
---|
| 16 |
|
---|
| 17 | let parser = function (source, options) {
|
---|
| 18 | return new Parser(source, options);
|
---|
| 19 | };
|
---|
| 20 |
|
---|
| 21 | parser.atword = function (opts) {
|
---|
| 22 | return new AtWord(opts);
|
---|
| 23 | };
|
---|
| 24 |
|
---|
| 25 | parser.colon = function (opts) {
|
---|
| 26 | return new Colon(Object.assign({ value: ':' }, opts));
|
---|
| 27 | };
|
---|
| 28 |
|
---|
| 29 | parser.comma = function (opts) {
|
---|
| 30 | return new Comma(Object.assign({ value: ',' }, opts));
|
---|
| 31 | };
|
---|
| 32 |
|
---|
| 33 | parser.comment = function (opts) {
|
---|
| 34 | return new Comment(opts);
|
---|
| 35 | };
|
---|
| 36 |
|
---|
| 37 | parser.func = function (opts) {
|
---|
| 38 | return new Func(opts);
|
---|
| 39 | };
|
---|
| 40 |
|
---|
| 41 | parser.number = function (opts) {
|
---|
| 42 | return new Num(opts);
|
---|
| 43 | };
|
---|
| 44 |
|
---|
| 45 | parser.operator = function (opts) {
|
---|
| 46 | return new Operator(opts);
|
---|
| 47 | };
|
---|
| 48 |
|
---|
| 49 | parser.paren = function (opts) {
|
---|
| 50 | return new Paren(Object.assign({ value: '(' }, opts));
|
---|
| 51 | };
|
---|
| 52 |
|
---|
| 53 | parser.string = function (opts) {
|
---|
| 54 | return new Str(Object.assign({ quote: '\'' }, opts));
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 | parser.value = function (opts) {
|
---|
| 58 | return new Value(opts);
|
---|
| 59 | };
|
---|
| 60 |
|
---|
| 61 | parser.word = function (opts) {
|
---|
| 62 | return new Word(opts);
|
---|
| 63 | };
|
---|
| 64 |
|
---|
| 65 | parser.unicodeRange = function (opts) {
|
---|
| 66 | return new UnicodeRange(opts);
|
---|
| 67 | };
|
---|
| 68 |
|
---|
| 69 | module.exports = parser;
|
---|