Stillat / vscode-antlers-language-server

Provides rich language features for Statamic's Antlers templating language, including code completions, syntax highlighting, and more.
https://antlers.dev
MIT License
36 stars 3 forks source link

Unexpected operator error when using multidimensional array in ternary or gatekeeper statement #97

Closed o1y closed 1 month ago

o1y commented 1 month ago

Describe the bug When using the ternary statement or gatekeeper with a multidimensional array, you get an (invalid) unexpected operator error.

[ANTLR_068] Unexpected operator while parsing input text.antlers(ANTLR_068)
[ANTLR_002] Unexpected end of input; expecting operand for operator T_VFBK near "?=".antlers(ANTLR_002)

Impacted Products Which Antlers Toolbox products does this bug apply to?

Versions and Other Plugins/Extensions v2.6.20

To Reproduce

{{ _class = column_size > 0 ?= _column_sizes['md'][column_size] }}

If you remove the md key, you won't see any errors. Workaround is to use additional single braces like so:

{{ _class = column_size > 0 ?= {_column_sizes['md'][column_size]} }}
Bildschirmfoto 2024-08-07 um 11 14 55

Expected behavior It shouldn't show any syntax error.

JohnathonKoster commented 1 month ago

Resolved in the following versions: