Skip to content

refactor(grammar): modernize string formatting with f-strings and improve type hinting - #1635

Open
ardozcnn wants to merge 2 commits into
lark-parser:masterfrom
ardozcnn:master
Open

refactor(grammar): modernize string formatting with f-strings and improve type hinting#1635
ardozcnn wants to merge 2 commits into
lark-parser:masterfrom
ardozcnn:master

Conversation

@ardozcnn

Copy link
Copy Markdown

Replaced legacy % string formatting across Symbol, Terminal, RuleOptions, and Rule classes with modern Python f-strings.

Added missing type hints for method parameters (other: Any, memo: Optional[Dict], f: Callable) and return types (-> None, -> str, -> int).

Included empty_indices in RuleOptions.repr to accurately reflect all initialization parameters.

Formatted tuple entries in serialize_fields consistently.

@erezsh

erezsh commented Aug 12, 2026

Copy link
Copy Markdown
Member

Overall looks okay. You can use tox to run the type checker with the official configuration.

@ardozcnn ardozcnn left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@ardozcnn

Copy link
Copy Markdown
Author

I ran the code can you check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants