Repository navigation
Conversation
The verifier removed a single level of parentheses, while the formatter can collapse ((x)) into x or (x), so any doubled parentheses were reported as a possible change in the AST.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
--verify, any expression wrapped in two pairs of parentheses is reported as a possible change:The formatter only drops the redundant pair, which is fine, but
remove_parenthesesin the verifier strips a single level, so the input still has(b >= 1 and b <= 2)where the output hasb >= 1 and b <= 2. It now strips every level.I found it on awesome's
spec/awful/prompt_spec.lua((byte and ((byte >= 194 and byte <= 244)) and ...)). The newtest_equivalent_removed_nested_parenthesesfails without the change.cargo testpasses with the default features,--all-features,--no-default-features,--features luauand--features lua54; clippy (--all-features -D warnings) andcargo fmt --checkare clean. A release build with--verifyover about 6,000 Lua/Luau files no longer reports any AST difference. The two remaining errors there are the hexadecimal float panic (#1180) and thelocal -- commentcase I added to #1176.This touches the
Unreleasedsection of the changelog like #1180, so whichever is merged second may need a trivial rebase.