rescript-compiler
rescript-compiler copied to clipboard
Syntax: E notation check is missing
let v = 1e
emits
var v = 1e;
export {
v ,
}
which is invalid in JS.
Same for
let v = 1e_
(or similar with any number of underscores)
BTW, also a bit weird (but all valid JS):
ReScript JS
let v = 1 let v = 1;
let v = 1. let v = 1;
let v = 1._ let v = 1.;
let v = 1.0 let v = 1.0;
BTW, also a bit weird (but all valid JS):
ReScript JS let v = 1 let v = 1; let v = 1. let v = 1; let v = 1._ let v = 1.; let v = 1.0 let v = 1.0;
I think the correct resolution is
let v = 1
let v = 1.0
// syntax error
let v = 1.0
Agreed!
Also, at the moment, you can basically do whatever you want underscore-wise, e.g.
let x = 1_________0_______.____2_____3
compiles to
let x = 10.23;
(FWIW this seems to be the case in OCaml, too.)
Lol, that's how we supported (superset of?) JS numeric separators