()
| 4 | const whitespaceMay = /^\s*/; |
| 5 | |
| 6 | function* ParseInt() { |
| 7 | const isNegative: boolean = yield has('-'); |
| 8 | const [stringValue]: [string] = yield /^\d+/; |
| 9 | return parseInt(stringValue, 10) * (isNegative ? -1 : 1); |
| 10 | } |
| 11 | |
| 12 | type Operator = '+' | '-' | '*' | '/'; |
| 13 |