File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 49
49
};
50
50
%}
51
51
52
+ int
53
+ -> "0" | [1-9] [0-9] :*
54
+
55
+ decimal
56
+ -> "." [0-9] :+
57
+
52
58
number
53
- -> "-" :? ( [0-9] :? "." [0-9] :+ | [1-9] [0-9] :* ( "." [0-9] :+):? | "0" ) {% d => Number (text (d)) %}
59
+ -> "-" :? ( int decimal | int | decimal ) {% d => Number (text (d)) %}
54
60
55
61
angle -> number ( "deg" | "rad" ) {% text %}
56
62
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ it('allows decimal values', () => {
22
22
expect ( parseProp ( 'number' , '-1.5' ) ) . toBe ( - 1.5 ) ;
23
23
expect ( parseProp ( 'number' , '-10.5' ) ) . toBe ( - 10.5 ) ;
24
24
expect ( parseProp ( 'number' , '-100.5' ) ) . toBe ( - 100.5 ) ;
25
+ expect ( parseProp ( 'number' , '.5' ) ) . toBe ( 0.5 ) ;
26
+ expect ( parseProp ( 'number' , '-.5' ) ) . toBe ( - 0.5 ) ;
25
27
} ) ;
26
28
27
29
it ( 'allows decimal values in transformed values' , ( ) => runTest ( [
You can’t perform that action at this time.
0 commit comments