zom-lang / zom

Zom is a Ahead Of Time compiled system programming language.
Other
4 stars 2 forks source link

Fixing lexer issues #18

Closed Larsouille25 closed 1 year ago

Larsouille25 commented 1 year ago

All of these issues are in the same issue because it's easier to follow and because there are only small errors.

  • [x] When a non-alphanumeric char is in an ident, (e.g: a@), the error is reported an char after:
    Err: Lexer, in file `<stdin>` at line 1 :
    ... |
    1  | a@
    ... |   ^
    Illegal Character
  • [x] Remove the magic if (while fixing the error) in the lexer, line 85
  • [x] When an underscore is in a identifier, an error occured but not the correct one,
    ~> func foo_bar(a, b)
    .eof
    cannot parse integer from empty string
  • [x] Make it possible to use _ in identifiers, at the beginning and in the middle.
Larsouille25 commented 1 year ago

It seems like the error with the IllegalCharError doesn't point to the correct char is even worse now

Larsouille25 commented 1 year ago

It seems like, now the error was been fixed, so I close this issue.