Skip to content

Float lexing is slightly wrong #40

@osa1

Description

@osa1

This line in the lexer:

@lit_float2 / ( [^\._a-zA-Z] | \r | \n )

Implements the "not immediately followed" part in the Rust lexical syntax spec: https://doc.rust-lang.org/reference/tokens.html#floating-point-literals

The code uses _a-zA-Z as the beginning of an identifier, but according to Rust spec any XID_Start is a valid identifier first character, so that part of the lexer should be updated with _ and @xid_start. (not sure what the right syntax for this is in alex)

(I don't have Haskell toolchain installed otherwise I would submit a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions