ballercat / walt

:zap: Walt is a JavaScript-like syntax for WebAssembly text format :zap:

Home Page:https://ballercat.github.io/walt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Number literals are not fully supported

JobLeonard opened this issue · comments

Bug Report

Overview

The following snippet don't compile:

const x: f32 = 1e10;
const y: i32 = 0xff;

Expected

x is assigned 10000000000, y is assigned 255.

Actual

Error: Unefined index for scope Operation. Possibly missing metadata. op: "Get" node: {
  "Type": "Identifier",
  "value": "e10",
  "range": [
    {
      "sourceLine": "  const x: f32 = 1e10;",
      "line": 3,
      "col": 18
    },
    {
      "sourceLine": "  const x: f32 = 1e10;",
      "line": 3,
      "col": 22
    }
  ],
  "meta": [],
  "params": [],
  "type": "f32"
}

(also, there's a spelling error: "Unefined")

Should be all set. Thanks for reporting!