Skip to content

Commit

Permalink
Getting ready for #186 - updated grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
meri committed Apr 8, 2014
1 parent 72d8efe commit 9d501fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
14 changes: 5 additions & 9 deletions src/main/antlr3/com/github/sommeri/less4j/core/parser/Less.g
Original file line number Diff line number Diff line change
Expand Up @@ -631,11 +631,6 @@ pseudoparameters:
| (b+=PLUS | b+=MINUS)? b+=NUMBER)
-> ^(NTH ^(TERM $a*) ^(TERM $b*));

//original
//referenceSeparator:
// GREATER
// | {!predicates.directlyFollows(input.LT(-1), input.LT(1))}?=> -> EMPTY_COMBINATOR;

referenceSeparator:
GREATER
| -> EMPTY_COMBINATOR;
Expand Down Expand Up @@ -680,9 +675,6 @@ mixinReferenceArguments
| expr (COMMA! variabledeclarationNoSemi (COMMA! variabledeclarationNoSemi)*)?
;

//reusableStructureName
// : a+=cssClassOrId ({predicates.directlyFollows(input.LT(-1), input.LT(1))}?=> a+=cssClassOrId)* -> ^(REUSABLE_STRUCTURE_NAME $a*);

reusableStructureName
: a+=cssClassOrId -> ^(REUSABLE_STRUCTURE_NAME $a*);

Expand Down Expand Up @@ -779,9 +771,13 @@ mathOperatorLowPrior
| MINUS
;

detachedRuleset
: general_body
;

expr
@init {enterRule(retval, RULE_EXPRESSION);}
: a=mathExprHighPrior (b+=operator c+=mathExprHighPrior)* -> ^(EXPRESSION $a ($b $c)*)
: (dr+=detachedRuleset | a+=mathExprHighPrior (b+=operator c+=mathExprHighPrior)*) -> ^(EXPRESSION $dr* $a* ($b $c)*)
;
finally { leaveRule(); }

Expand Down
19 changes: 5 additions & 14 deletions src/test/resources/minitests/debug1.less
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
@usedScope: global;
.mixin() {
@usedScope: mixin;
.global when (@usedScope=global) {
guard-used-scope: global;
declaration-used-scope: @usedScope;
}
.mixin when (@usedScope=mixin) {
guard-used-scope: mixin;
declaration-used-scope: @usedScope;
}
@usedScope: mixin;
}
@property: color;

.mixin();
.widget {
@{property}: #0ee;
background-@{property}: #999;
}

0 comments on commit 9d501fa

Please sign in to comment.