Skip to content

Commit

Permalink
Fix #67 LESS: Minus ('-') is wrongly considered as unknown function
Browse files Browse the repository at this point in the history
  • Loading branch information
racodond committed Oct 19, 2017
1 parent 6a936b7 commit 7634809
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
filter: alpha(opacity=50);
filter: color("#123");
filter: desaturate("#123");
top: -(@timeline-h-size-step/2)-(@timeline-h-size-line/2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,12 @@ private static void macros(LexerlessGrammarBuilder b) {
b.rule(_IDENT).is(
b.firstOf(
b.regexp("(?i)(progid:DXImageTransform\\.Microsoft\\.[a-z]+)"),
b.sequence("-", b.oneOrMore(_NMCHAR)),
b.sequence(_NMSTART, b.zeroOrMore(_NMCHAR))))
.skip();

b.rule(_NMSTART).is(
b.firstOf(b.regexp("(?i)[_a-z]"), "-", "*", _NONASCII, _ESCAPE)).skip();
b.firstOf(b.regexp("(?i)[_a-z]"), "*", _NONASCII, _ESCAPE)).skip();

b.rule(_NONASCII).is(b.regexp("[^\\x00-\\xED]")).skip();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public void notIdent() {
checkNotParsed("123");
checkNotParsed("123px");
checkNotParsed("@{abc}");
checkNotParsed("-");
checkNotParsed("-(");
}

private IdentifierTree checkParsed(String toParse, String expectedIdent) {
Expand Down
1 change: 1 addition & 0 deletions its/ruling/projects/custom/less/unknownFunctions.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
filter: alpha(opacity=50);
filter: color("#123");
filter: desaturate("#123");
top: -(@timeline-h-size-step/2)-(@timeline-h-size-line/2);
}

0 comments on commit 7634809

Please sign in to comment.