Skip to content

Commit

Permalink
Fix #29 Add missing SCSS modulo operator (%)
Browse files Browse the repository at this point in the history
  • Loading branch information
racodond committed Jun 6, 2017
1 parent b9ce45e commit 6067ccd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ private static void scss(LexerlessGrammarBuilder b) {
"-",
"/",
"*",
"%",
"==",
"!=",
"=",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public Tree ANY() {
BRACKET_BLOCK(),
URI(),
FUNCTION(),
PSEUDO_SELECTOR(),
PERCENTAGE(),
DIMENSION(),
NUMBER(),
Expand Down Expand Up @@ -109,7 +108,6 @@ public Tree ANY_WITHOUT_COMMA_SEPARATED_LIST() {
BRACKET_BLOCK(),
URI(),
FUNCTION(),
PSEUDO_SELECTOR(),
PERCENTAGE(),
DIMENSION(),
NUMBER(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum OPERATOR {
MINUS("-"),
TIMES("*"),
DIV("/"),
MODULO("%"),
EQUALS("="),
DOUBLE_EQUALS("=="),
NOT_EQUALS("!="),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public void scssOperator() {
assertThat(tree.type()).isEqualTo(ScssOperatorTree.OPERATOR.OR);
assertThat(tree.operator().text()).isEqualTo("or");

tree = checkParsed(" or");
assertThat(tree.type()).isEqualTo(ScssOperatorTree.OPERATOR.OR);
assertThat(tree.operator().text()).isEqualTo("or");
tree = checkParsed(" %");
assertThat(tree.type()).isEqualTo(ScssOperatorTree.OPERATOR.MODULO);
assertThat(tree.operator().text()).isEqualTo("%");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ public void scssVariableDeclaration() {
" lg: $grid-gutter-width-base,\n" +
" xl: $grid-gutter-width-base\n" +
") !default;");

checkParsed(" $abc: ($top + $bot) % $component-space");
}

@Test
Expand Down

0 comments on commit 6067ccd

Please sign in to comment.