File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,13 @@ Parser.prototype.comma = function(){
2121 return { type : 'comma' , string : ',' } ;
2222} ;
2323
24+ Parser . prototype . operator = function ( ) {
25+ var m = / ^ \/ * / . exec ( this . str ) ;
26+ if ( ! m ) return ;
27+ this . skip ( m [ 0 ] ) ;
28+ return { type : 'operator' , value : '/' } ;
29+ } ;
30+
2431Parser . prototype . ident = function ( ) {
2532 var m = / ^ ( [ \w - ] + ) * / . exec ( this . str ) ;
2633 if ( ! m ) return ;
@@ -32,7 +39,7 @@ Parser.prototype.ident = function(){
3239} ;
3340
3441Parser . prototype . int = function ( ) {
35- var m = / ^ ( ( \d + ) ( \S + ) ? ) * / . exec ( this . str ) ;
42+ var m = / ^ ( ( \d + ) ( [ ^ \s \/ ] + ) ? ) * / . exec ( this . str ) ;
3643 if ( ! m ) return ;
3744 this . skip ( m [ 0 ] ) ;
3845 var n = ~ ~ m [ 2 ] ;
@@ -47,7 +54,7 @@ Parser.prototype.int = function(){
4754} ;
4855
4956Parser . prototype . float = function ( ) {
50- var m = / ^ ( ( (?: \d + ) ? \. \d + ) ( \S + ) ? ) * / . exec ( this . str ) ;
57+ var m = / ^ ( ( (?: \d + ) ? \. \d + ) ( [ ^ \s \/ ] + ) ? ) * / . exec ( this . str ) ;
5158 if ( ! m ) return ;
5259 this . skip ( m [ 0 ] ) ;
5360 var n = parseFloat ( m [ 2 ] ) ;
@@ -154,7 +161,8 @@ Parser.prototype.gradient = function(){
154161
155162Parser . prototype . value = function ( ) {
156163 this . str = this . str . replace ( / ^ \s + / , '' ) ;
157- return this . number ( )
164+ return this . operator ( )
165+ || this . number ( )
158166 || this . color ( )
159167 || this . gradient ( )
160168 || this . url ( )
You can’t perform that action at this time.
0 commit comments