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

lexer: add floats #56

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

lexer: add floats #56

wants to merge 1 commit into from

Conversation

garritfra
Copy link
Collaborator

Fixes #40

Description

Adds the float datatype.

ToDo

  • Proposed feature/fix is sufficiently tested
  • Proposed feature/fix is sufficiently documented
  • The "Unreleased" section in the changelog has been updated, if applicable

@YerinAlexey
Copy link
Collaborator

This is a good start, but it misses e[N] and e[-N] exponent suffixes, which are useful sometimes. But we might not care about them to simplify this

Next step would be to implement them for generators, for JS and C it's extremely easy. For QBE it requires a bit more work to add float instructions and use them in binops

@@ -131,6 +131,7 @@ pub enum TokenKind {
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub enum Value {
Int,
Float,
Copy link
Collaborator

@YerinAlexey YerinAlexey Oct 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should keep floats and integers inside Value like we do with strings?

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

Successfully merging this pull request may close these issues.

Floating point data type
2 participants