Skip to content

exceptions.py: sort set of expected things to get deterministic result#1575

Merged
erezsh merged 1 commit intolark-parser:masterfrom
denballakh:patch-1
Mar 6, 2026
Merged

exceptions.py: sort set of expected things to get deterministic result#1575
erezsh merged 1 commit intolark-parser:masterfrom
denballakh:patch-1

Conversation

@denballakh
Copy link
Contributor

Currently expected tokens are stored in a set, and because of that the order they appear in error message is unstable - different runs may produce different orderings.

Here I sort the set of expected tokens, so that the order is guaranteed to be stable between runs.

Currently expected tokens are stored in a set, and because of that the order they appear in error message is unstable - different runs may produce different orderings.

Here I sort the set of expected tokens, so that the order is guaranteed to be stable between runs.
@erezsh erezsh merged commit 52ef09d into lark-parser:master Mar 6, 2026
9 checks passed
@erezsh
Copy link
Member

erezsh commented Mar 6, 2026

Looks good to me. Thanks for contributing.

@denballakh denballakh deleted the patch-1 branch March 7, 2026 17:37
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