Skip to content

Floating Point Numbers Not Supported #13

@SAMBA8695

Description

@SAMBA8695

Description

The language currently supports only integer literals. Floating point numbers are not recognized by the lexer or handled by the parser, AST, IR, or LLVM backend.

Example unsupported input:

let x = 3.14;

This limits the usefulness of Cow for numeric computation.

Current Behavior

  • Lexer recognizes only integer literals
  • Decimal numbers are tokenized incorrectly or ignored
  • AST supports only integer values
  • LLVM output uses only integer (i32) types

Expected Behavior

  • Lexer should recognize floating point literals
  • Parser should construct AST nodes for floats
  • AST and IR should distinguish integer vs floating types
  • LLVM backend should emit appropriate float or double instructions

Suggested Direction

  • Add TOKEN_FLOAT
  • Introduce AST_FLOAT
  • Track numeric types during parsing or IR generation
  • Emit LLVM float / double instructions as appropriate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions