lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.75k stars 401 forks source link

Update lexer_state to lexer_thread to avoid deprecation warnings #1285

Closed geographika closed 1 year ago

geographika commented 1 year ago

When running pytest on modules that depend on Lark I'm getting 100s of deprecation warnings:

lib\site-packages\lark\parsers\lalr_interactive_parser.py:27: DeprecationWarning: lexer_state will be removed in subsequent releases. Use lexer_thread instead.
    warnings.warn("lexer_state will be removed in subsequent releases. Use lexer_thread instead.", DeprecationWarning)

Raised at:

https://github.com/lark-parser/lark/blob/7043c3ee20731ca297b93f1009e7474915d06c34/lark/parsers/lalr_interactive_parser.py#L24

These appear to come from the use of lexer_state within Lark. Updating to lexer_thread in resume_parse removes these errors.

erezsh commented 1 year ago

Great, thanks!