We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
~/bugs/flow-parser-number-bug ❯ node --version v7.2.0 ~/bugs/flow-parser-number-bug ❯ npm i flow-parser /home/lydell/bugs/flow-parser-number-bug └─┬ flow-parser@0.38.0 ├── ast-types@0.8.18 ├── colors@1.1.2 └── minimist@1.2.0 ~/bugs/flow-parser-number-bug ❯ node > try { require('flow-parser').parse('0274134317073') } catch (e) { console.log('err', e) } err [ 0, [ 248, aw { t: 0, c: 'Failure', l: 7 }, -3 ], aw { t: 0, c: 'int_of_string', l: 13 } ] undefined >
Expectations:
Error
Array
The non-JS version of the parser seems to be doing fine:
~/bugs/flow-parser-number-bug ❯ npm i flow-bin /home/lydell/bugs/flow-parser-number-bug └── flow-bin@0.38.0 ~/bugs/flow-parser-number-bug ❯ echo '0274134317073' | flow ast --pretty { "errors":[], "tokens":[], "type":"Program", "loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "range":[0,13], "body":[ { "type":"ExpressionStatement", "loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "range":[0,13], "expression":{ "type":"Literal", "loc":{"source":null,"start":{"line":1,"column":0},"end":{"line":1,"column":13}}, "range":[0,13], "value":25257156155, "raw":"0274134317073" } } ], "comments":[] }
The text was updated successfully, but these errors were encountered:
huh. the JS version of the flow parser uses js_of_ocaml which is apparently limited to 32-bit integers. the ocaml version uses 63-bit integers.
js_of_ocaml
trying 25257156155;; or int_of_string "0o0274134317073;;" in Try OCaml similarly errors.
25257156155;;
int_of_string "0o0274134317073;;"
this might be a tough one to fix. definitely agreed that it shouldn't kill the parser, though.
Sorry, something went wrong.
oh, not as bad as I thought. will fix!
6ed6132
mroch
No branches or pull requests
Expectations:
Error
to be thrown, not anArray
.)The non-JS version of the parser seems to be doing fine:
The text was updated successfully, but these errors were encountered: