Skip to content

Specification and Grammar incomplete with regards to lexing rules #24272

@bruno-medeiros

Description

@bruno-medeiros

Both the reference (http://doc.rust-lang.org/reference.html#lexical-structure) and the grammar reference (http://doc.rust-lang.org/grammar.html#lexical-structure) are very incomplete with regards to the lexing rules. For example:

  • lifetimes token not documented
  • attributes token not documented
  • character/string literal token rules are incomplete, they do not seem to specify the b/br# prefixes for character and string literals.

I'm writing a lexer for an IDE (to do syntax highlighting), and since I'm not yet familar with Rust itself, this makes my life a bit harder...

Activity

steveklabnik

steveklabnik commented on Apr 10, 2015

@steveklabnik
Member

Yup, we'd love to get this filled out.

fhahn

fhahn commented on Apr 10, 2015

@fhahn
Contributor

@bruno-medeiros there exists an Antler lexer, which only differs from the Rust lexer slightly, maybe this could help.

bruno-medeiros

bruno-medeiros commented on Apr 10, 2015

@bruno-medeiros
Author

there exists an Antler lexer, which only differs from the Rust lexer slightly, maybe this could help.

Yeah it does. Another user had also directed me to that.

Hum, and I also just realized the Attribute rule is not a token, but a grammar rule...

steveklabnik

steveklabnik commented on Jan 15, 2016

@steveklabnik
Member

I'm going to close this in favor of #30942, which is more general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @steveklabnik@fhahn@bruno-medeiros

        Issue actions

          Specification and Grammar incomplete with regards to lexing rules · Issue #24272 · rust-lang/rust