lark-parser / lark_cython

Cython plugin for Lark, reimplementing the LALR parser & lexer for better performance
MIT License
45 stars 5 forks source link

Resolve differences from Lark #6

Closed wqh17101 closed 1 year ago

wqh17101 commented 2 years ago

Suggestion

I mentioned the differences from Lark, is there any way to resolve? Describe alternatives you've considered Deploy from lark without any changes

erezsh commented 2 years ago

Can you be more specific?

Anything that works with lark_cython will also work with Lark.

wqh17101 commented 2 years ago

@erezsh Token instances do not inherit from str. You must use the value attribute to get the string. This one

erezsh commented 2 years ago

Yes, I don't know of a way to solve it, while maintaining performance.

I suggest you always use .value in both lark-cython and Lark.

Or, write a transformer that converts lark-cython.Token to lark.Token, but of course at the cost of performance.

wqh17101 commented 2 years ago

All right , i will try.