_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

[Bug]scientific number notation is not supported

Open rozek opened this issue 3 years ago • 0 comments

The title already describes the problem: code like

 log 1e6

throws the following parser error

_hyperscript.min.js:1 hyperscript errors were found on the following element: <script type=​"text/​hyperscript">​…​</script>​ 

 Unexpected Token : e

    log 1e+6
          ^^

 Error: Unexpected Token : e

    log 1e+6
          ^^


    at a.raiseParseError (https://127.0.0.1:7443/js/_hyperscript.min.js:1:11785)
    at a.raiseParseError (https://127.0.0.1:7443/js/_hyperscript.min.js:1:11843)
    at a.parseHyperScript (https://127.0.0.1:7443/js/_hyperscript.min.js:1:11945)
    at o.initElement (https://127.0.0.1:7443/js/_hyperscript.min.js:1:18785)
    at https://127.0.0.1:7443/js/_hyperscript.min.js:1:18448
    at o.forEach (https://127.0.0.1:7443/js/_hyperscript.min.js:1:13998)
    at o.processNode (https://127.0.0.1:7443/js/_hyperscript.min.js:1:18378)
    at HTMLDocument.<anonymous> (https://127.0.0.1:7443/js/_hyperscript.min.js:1:95595)

Addendum: on the other hand, the following code

    set x to 0.0000000000001 as String
    log x

properly displays 1e-13 which proves that _hyperscript definitely knows that notation!

rozek avatar Jul 26 '22 14:07 rozek