Float tokens, possibly with unit
()
| 77 | |
| 78 | /** Float tokens, possibly with unit */ |
| 79 | private float(): NumberToken | undefined { |
| 80 | const m = /^(((?:[-+]?\d+)?\.\d+)(\S+)?) */.exec(this.str); |
| 81 | if (!m) return; |
| 82 | this.skip(m); |
| 83 | const n = parseFloat(m[2]); |
| 84 | const u = m[3] || ''; |
| 85 | return { type: 'number', string: m[1], unit: u, value: n }; |
| 86 | } |
| 87 | |
| 88 | /** Number tokens, either float or int */ |
| 89 | private number(): NumberToken | undefined { |