Details
Description
Incorrect things that are allowed:
- minus ("-") in variable names
Correct things that are not allowed:
- empty xml tag "<></>"
- xml binding on the xml tag name "<{name}/>"
- xml binding on an xml attribute "<test {name}='something'/>"
- switch statement requires default case to be last but should be allowed at any position
- use namespace directive should be allowed in any statement
- imports and includes should be allowed in any block
- imports/use namespace/includes are not required to have semicolons at the end (or any other statement)
Fix is in this pull request: https://github.com/SonarCommunity/sonar-flex/pull/1
Issue Links
- is related to
-
SONARPLUGINS-2195
Grammar: incorrect AST for expression statement "b = a- 1" (no space between identifier and minus)
-
-
SONARPLUGINS-2244
Grammar: switch statement requires default case to be last but should be allowed at any position
-
-
SONARPLUGINS-2246
Grammar: xml binding should be allowed for tag name and for attribute
-
-
SONARPLUGINS-2270
Grammar: semicolon can be omitted at the end of import/use namespace/include as for any other statement
-
-
SONARPLUGINS-2271
Grammar: "include" / "import" and "use namespace" directives can be used as a statement
-
Hi Jeffrey,
First of all thanks for your feedback, investigations and contribution - for sure we will do our best to integrate it into upcoming version.
Regarding issue with minus in variable name - I created separate ticket
SONARPLUGINS-2195and added comment to it, which shows that fix not trivial as proposed. And that's why we prefer small separate patches. So I'm going to split your issue and pull-request on smaller pieces and verify each change by our integration tests.