Integer tokens, possibly with unit
()
| 67 | |
| 68 | /** Integer tokens, possibly with unit */ |
| 69 | private int(): NumberToken | undefined { |
| 70 | const m = /^(([-+]?\d+)(\S+)?) */.exec(this.str); |
| 71 | if (!m) return; |
| 72 | this.skip(m); |
| 73 | const n = parseInt(m[2], 10); |
| 74 | const u = m[3] || ''; |
| 75 | return { type: 'number', string: m[1], unit: u, value: n }; |
| 76 | } |
| 77 | |
| 78 | /** Float tokens, possibly with unit */ |
| 79 | private float(): NumberToken | undefined { |