grammars-v4
grammars-v4 copied to clipboard
[SCSS] @for loop should have expressions instead of numbers
According to https://github.com/sass/sass/blob/main/spec/at-rules/for.md the @for-loop in scss is defined as having
'from' expression ('to'|'through') expression instead of the currently given fromNumber and throughNumber
https://github.com/antlr/grammars-v4/blob/80346f3b6bb05e67aa45003531d066f1890a534f/scss/ScssParser.g4#L170-L183
For my purposes it was enough deleting fromNumber and throughNumber and replacing it with expression in forDeclaration, but I am not sure if expression in the grammar is defined in the same way as by the sass vendors, thus I hesitate to create a PR (:
//for
forDeclaration
: AT_FOR variableName 'from' expression ('to'|'through') expression block
; // ^^^^^^^^^^ ^^^^^^^^^^