Closed tjvr closed 7 years ago
This allows writing rules in the object style, where the rules have the same tokenType but different properties (e.g. lineBreaks, or state manipulation).
tokenType
lineBreaks
e.g.
STRING: [ {match: /"""[^]*?"""/, lineBreaks: true}, {match: /"(?:\\["\\]|[^"\\\n])*?"/}, {match: /'(?:\\['\\]|[^'\\\n])*?'/}, ],
Do we want it to accept mixed arrays like [/regexp/, 'string', {match: /something/}]? If so, we should test for that.
[/regexp/, 'string', {match: /something/}]
This allows writing rules in the object style, where the rules have the same
tokenType
but different properties (e.g.lineBreaks
, or state manipulation).e.g.