Skip to content
New issue

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

Two syntax coloring issues #117

Open
dwhall opened this issue Oct 31, 2024 · 0 comments
Open

Two syntax coloring issues #117

dwhall opened this issue Oct 31, 2024 · 0 comments

Comments

@dwhall
Copy link

dwhall commented Oct 31, 2024

  1. A number in scientific notation does not colorize completely when 'E' is used for the exponent.
let v1 = 6e23   # good
let v2 = 6E23   # 6 is colored, E23 is not

image

  1. Custom numeric literal does not colorize properly
type Foo* = distinct uint32

func parseAnyInt(s: static string): int =
  const lowercase = toLower(s)
  when lowercase.startsWith("0x") or lowercase.startsWith("-0x"):
    parseHexInt(lowercase)
  else:
    parseInt(s)

func `'foo`*(s: static string): Foo =
  const n = parseAnyInt(s)
  Foo(n)

func `'bar`*(s: static string): Foo =
  const n = parseAnyInt(s)
  Foo(n)

let f1 = 0x41'foo   # foo is white
let f2 = 0x42'bar   # bar is red
let f3 = -0x43'bar  # wonky until the apostrophe

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant