maurobalbi / glas

Apache License 2.0
41 stars 2 forks source link

Syntax error in hexadecimal representation with letters #20

Open haroflow opened 2 months ago

haroflow commented 2 months ago

Hi, thanks for this extension, it really helps learning the language!

I don't know if it's Gleam LSP or glas, but this code is throwing syntax errors when there are letters in the hex values:

import gleam/io

fn dbg(i: Int) {
  io.debug(i)
}

pub fn main() {
  io.println("Hello from glas_test!")
  dbg(0x0)
  dbg(0x00112233)
  dbg(0x0a)
  dbg(0xa0)
  dbg(0xaa)
  dbg(0xAA)
  dbg(0xAABBCCDD)
}

image

The program compiles and runs just fine, it's not a big problem for me. The official gleam extension doesn't show this error, but it's too early to use it.

My setup:

maurobalbi commented 2 months ago

Thanks for the report! This is a bug in the parser. There's still some discrepancies between this and the official compiler which I'm hoping to iron out eventually!