diff --git a/css-frontend/src/main/java/org/sonar/css/parser/less/LessGrammar.java b/css-frontend/src/main/java/org/sonar/css/parser/less/LessGrammar.java index 6f9cb2c3..b9d288ea 100644 --- a/css-frontend/src/main/java/org/sonar/css/parser/less/LessGrammar.java +++ b/css-frontend/src/main/java/org/sonar/css/parser/less/LessGrammar.java @@ -116,6 +116,7 @@ public Tree ANY_WITHOUT_COMMA_SEPARATED_LIST() { PSEUDO_SELECTOR(), PARENTHESIS_BLOCK(), BRACKET_BLOCK(), + STATEMENT_BLOCK(), PERCENTAGE(), DIMENSION(), NUMBER(), diff --git a/css-frontend/src/test/java/org/sonar/css/parser/less/StyleSheetTreeTest.java b/css-frontend/src/test/java/org/sonar/css/parser/less/StyleSheetTreeTest.java index bdc6dd3a..eb8b9b57 100644 --- a/css-frontend/src/test/java/org/sonar/css/parser/less/StyleSheetTreeTest.java +++ b/css-frontend/src/test/java/org/sonar/css/parser/less/StyleSheetTreeTest.java @@ -155,6 +155,27 @@ public void stylesheet() throws Exception { "}\n" + ".sprites(@sprites, @i + 1);\n" + "}"); + + checkParsed("// declare detached ruleset\n" + + "@detached-ruleset: { background: red; };\n" + + "\n" + + "// use detached ruleset\n" + + ".top {\n" + + " @detached-ruleset(); \n" + + "}"); + + checkParsed(".desktop-and-old-ie(@rules) {\n" + + " @media screen and (min-width: 1200px) { @rules(); }\n" + + " html.lt-ie9 & { @rules(); }\n" + + "}\n" + + "\n" + + "header {\n" + + " background-color: blue;\n" + + "\n" + + " .desktop-and-old-ie({\n" + + " background-color: red;\n" + + " });\n" + + "}"); } private StyleSheetTree checkParsed(String toParse) {