Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parse error when using parentheses in a group in a key value command argument #3821

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Add checkboxes to graphic insertion wizard for relative width or height

### Fixed
* Fix parse error when using parentheses in a group in a key value command argument

## [0.9.10-alpha.4] - 2024-12-21

Expand Down
2 changes: 1 addition & 1 deletion src/nl/hannahsten/texifyidea/grammar/Latex.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ parameter_group ::= OPEN_BRACE parameter_group_text CLOSE_BRACE { pin=1 }
// Be sure to capture the whitespace before and after the actual content as groups are meant to capture
// *everything* inside them.
// This element is needed instead of parameter_text in order to avoid parse errors for various other tokens that do not appear in parameter_text because they are not usually part of the reference
parameter_group_text ::= (parameter_text | group | COMMA | EQUALS | OPEN_BRACKET | CLOSE_BRACKET)* { hooks = [wsBinders="GREEDY_LEFT_BINDER, GREEDY_RIGHT_BINDER"] }
parameter_group_text ::= (parameter_text | group | COMMA | EQUALS | OPEN_BRACKET | CLOSE_BRACKET | OPEN_PAREN | CLOSE_PAREN | OPEN_ANGLE_BRACKET | CLOSE_ANGLE_BRACKET)* { hooks = [wsBinders="GREEDY_LEFT_BINDER, GREEDY_RIGHT_BINDER"] }

comment ::= COMMENT_TOKEN

Expand Down
2 changes: 2 additions & 0 deletions test/nl/hannahsten/texifyidea/psi/LatexParserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class LatexParserTest : BasePlatformTestCase() {
${'$'}\test{\cmd{a}[b]}${'$'}
\newcolumntype{P}[1]{>{\raggedright\arraybackslash}p{#1}}
\anycommand{test = {Some text with (Round Brackets)}}
""".trimIndent()
)
myFixture.checkHighlighting()
Expand Down
Loading