Repository navigation
Fix vertical alignment after empty string literals - #423
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
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.
Problem
Fixes #412.
With
--vertical-align, a supportedCHECK (description <> '')expression prevents alignment of that table and subsequent tables. The tokenizer's single-quoted-string alternative requires at least one character, so the fallback token consumes''together with following closing parentheses. The alignment pass then loses track of the table body's depth.Change
Allow an empty single-quoted token using the existing string-token rule. Add a public Beautify API regression for the affected table and an independent following table, also checking preservation of the literal.
Validation
57cd377321c8474a17ae59a139efa9c4019f21bd, passes all 3 with this change (Ubuntu 24.04, Perl 5.38.2).git diff --checkpassed.Only synthetic SQL was formatted; no SQL was executed. Full upstream SQL regression corpus and Perl-version CI matrix were not run locally. CGI runtime was not tested because CGI.pm is absent in the local Perl environment.