Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWhitespace improvements #2925
Whitespace improvements #2925
Conversation
|
Note that the new modifier works on both sides (unlike the previous attempt of others PRs on the same matter). |
|
If you want to review the PR, I suggest you to read each commit, which is much easier. |
| } else { | ||
| // whitespace_line_trim detected ({%~, {{~ or {#~) | ||
| // don't trim \r and \n | ||
| $text = rtrim($text, " \t\0\x0B"); |
stof
Apr 3, 2019
Member
shouldn't this use the whitespace_line_chars option ?
shouldn't this use the whitespace_line_chars option ?
| } else { | ||
| // whitespace_line_trim detected ({%~, {{~ or {#~) | ||
| // don't trim \r and \n | ||
| $text = rtrim($text, " \t\0\x0B"); |
stof
Apr 3, 2019
Member
shouldn't this use the whitespace_line_chars option ?
shouldn't this use the whitespace_line_chars option ?
fabpot
Apr 3, 2019
Author
Contributor
no, whitespace_line_chars are quoted
no, whitespace_line_chars are quoted
|
To optimize the lexing, I think we should be able to make lots of quantifiers possessive in these regexes ( |
|
I'm not a big fan of using Jinja uses |
|
I thought about using quantifiers possessive, but did not do it for BC. |
|
@javiereguiluz I would argue that using similar characters is a good thing as they are doing almost the same thing :) |
|
Solution for the operator to do something like in my proposal: |
This PR was squashed before being merged into the 1.x branch (closes #2925). Discussion ---------- Whitespace improvements This pull request introduces a new whitespace control modifier in addition to the `-` one. The new `~` modifier consume whitespace excluding newlines. closes #2924, closes #1005, closes #1423, closes #1569, and many already closed ones. Commits ------- 96eab47 added support for a new whitespace trimming option 7e3ec0f made Lexer regexes more readable 591da36 simplified Lexer regexes
This pull request introduces a new whitespace control modifier in addition to the
-one. The new~modifier consume whitespace excluding newlines.closes #2924, closes #1005, closes #1423, closes #1569, and many already closed ones.