File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -462,9 +462,20 @@ function value(&$value) {
462
462
463
463
// see if there is a negation
464
464
$ s = $ this ->seek ();
465
- if ($ this ->literal ('- ' , false ) && $ this ->variable ($ var )) {
466
- $ value = array ('negative ' , array ('variable ' , $ var ));
467
- return true;
465
+ if ($ this ->literal ('- ' , false )) {
466
+ $ value = null ;
467
+ if ($ this ->variable ($ var )) {
468
+ $ value = array ('variable ' , $ var );
469
+ } elseif ($ this ->buffer {$ this ->count } == "( " && $ this ->expression ($ exp )) {
470
+ $ value = $ exp ;
471
+ } else {
472
+ $ this ->seek ($ s );
473
+ }
474
+
475
+ if (!is_null ($ value )) {
476
+ $ value = array ('negative ' , $ value );
477
+ return true;
478
+ }
468
479
} else {
469
480
$ this ->seek ($ s );
470
481
}
@@ -795,7 +806,7 @@ function tag(&$tag, $simple = false) {
795
806
function func (&$ func ) {
796
807
$ s = $ this ->seek ();
797
808
798
- if ($ this ->match ('(%|[\w\-_][\w\-_:\.]* ) ' , $ m ) && $ this ->literal ('( ' )) {
809
+ if ($ this ->match ('(%|[\w\-_][\w\-_:\.]+|[\w_] ) ' , $ m ) && $ this ->literal ('( ' )) {
799
810
$ fname = $ m [1 ];
800
811
801
812
$ s_pre_args = $ this ->seek ();
Original file line number Diff line number Diff line change 61
61
}
62
62
63
63
64
+ .negation {
65
+ hello: - (1px );
66
+ hello: 0 - (1px );
67
+
68
+ @something : 10 ;
69
+ hello: - @something ;
70
+ }
71
+
72
+
64
73
// and now here are the tests
65
74
66
75
.test {
Original file line number Diff line number Diff line change 25
25
mul : 50 ;
26
26
}
27
27
.keyword-names { height : "hello" 25 ; }
28
+ .negation {
29
+ hello : -1px ;
30
+ hello : -1px ;
31
+ hello : -10 ;
32
+ }
28
33
.test {
29
34
single : 5 ;
30
35
single : 10 ;
You can’t perform that action at this time.
0 commit comments