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

We only get Const::Num, never Const::Int #331

Closed
HalidOdat opened this issue Apr 17, 2020 · 2 comments · Fixed by #338
Closed

We only get Const::Num, never Const::Int #331

HalidOdat opened this issue Apr 17, 2020 · 2 comments · Fixed by #338
Assignees
Labels
bug Something isn't working lexer Issues surrounding the lexer
Milestone

Comments

@HalidOdat
Copy link
Member

This is a bug in the lexer.

Currently we only have one numerical token type NumericalLiteral which is of type f64, hence all numerical values are converted to f64 and we only get Cont::Num.

This bug blocks #328

@HalidOdat HalidOdat added bug Something isn't working parser Issues surrounding the parser lexer Issues surrounding the lexer labels Apr 17, 2020
@HalidOdat HalidOdat added this to the v0.8.0 milestone Apr 17, 2020
@HalidOdat HalidOdat self-assigned this Apr 17, 2020
@HalidOdat HalidOdat removed the parser Issues surrounding the parser label Apr 17, 2020
@jasonwilliams
Copy link
Member

What scenarios do we get int?
On phone at the moment so cant load up the spec

@Razican
Copy link
Member

Razican commented Apr 18, 2020

What scenarios do we get int?

As per the spec, a NumericLiteral is one of

  • DecimalLiteral
  • DecimalBigIntegerLiteral
  • NonDecimalIntegerLiteral
  • NonDecimalIntegerLiteral BigIntLiteralSuffix

So it seems we need to take into accounts integers as a separate type. This seems to be used for octal, hexadecimal and binary representations too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lexer Issues surrounding the lexer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants