Shahar Soel

Results 187 comments of Shahar Soel

> Do you think this approach could also work with SimpleLazyTokens? These tokens are just javascript Objects. So you can add any property to them whenever, where-ever you like. *...

> Why return an array that always contains one string item? To be compatible with the RegExp.exec API. because the result of a custom match and a regular regExp match...

> In that case the custom matcher could also be allowed to return an object for a single emitted token or an array for several emitted tokens. Thats a good...

> Note that you can extend RegExp and define Symbol.match on its prototype to override matching behavior. I did not know this. I wonder in what EcmaScript versions this is...

https://jsperf.com/exec-vs-match-vs-test-vs-search/10

**exec** which the Chevrotain lexer already uses seems faster than match on modern chrome. So i'm not sure if there is any room for improvement here. But I'm always happy...

**exec** which the Chevrotain lexer already uses seems faster than match on modern chrome. So i'm not sure if there is any room for improvement here. But I'm always happy...

I'm keeping this open for now as there is a major refactoring in progress And I'd like to reexamine these "custom token factories" after the refactoring has finished.

lexer refactoring has been completed with large benefits for both performance and long term code maintainability. I'm afraid I don't see a good way to introduce "custom token factories" or...

> Just wondering if it's possible/performant to put the match result on IToken, which would also provide full access to the capture groups. It should be possible. The IToken is...