Skip to content

Fixes no newline before nested ReservedTopLevel tokens.#1

Open
ruffin-- wants to merge 1 commit intoAndrewWhitaker:masterfrom
ruffin--:ReservedTopLevel_NewLineFix
Open

Fixes no newline before nested ReservedTopLevel tokens.#1
ruffin-- wants to merge 1 commit intoAndrewWhitaker:masterfrom
ruffin--:ReservedTopLevel_NewLineFix

Conversation

@ruffin--
Copy link

@ruffin-- ruffin-- commented Aug 1, 2014

Line 232 was Trimming too much. See original:
https://github.com/jdorn/sql-formatter/blob/master/lib/SqlFormatter.php#L634

$return = rtrim($return,$tab).str_repeat($tab, $indent_level);

Only need to trim tab characters from the end of result that SqlFormatter had already inserted.
This was TrimEnding away any and all whitespace, including newline from previous addition.

Line 232 was `Trim`ming too much. See original:
https://github.com/jdorn/sql-formatter/blob/master/lib/SqlFormatter.php#L634

`$return = rtrim($return,$tab).str_repeat($tab, $indent_level);`

Only need to trim tab characters from the end of `result` that `SqlFormatter` had already inserted.
This was `TrimEnd`ing away any and all whitespace, including newline from previous addition.
ruffin-- pushed a commit to ruffin--/SqlProfilerQueryCleaner that referenced this pull request Aug 1, 2014
SQL parser is from the following project (MIT licensed):
https://github.com/AndrewWhitaker/sql-formatter

Note that the dll uploaded with this commit was run against a pull request I've submitted to that project, which fixes a small porting bug with top level tokens and newline formatting:
AndrewWhitaker/sql-formatter#1
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.

1 participant