Skip to content

Design string tokens #6308

@matklad

Description

@matklad

We currently have ast::String for "" strings and ast::RawString for r"". We don't have a type to represent either of those.

Steps:

  1. Find out places in grammar where we need this. One is extern "ABI". Are there anything else?
  2. If the answer is no, we should change the grammar of ABI to contain ast::Literal (like we do for attributes).
  3. If the answer is yes, we should consider adding a StringOrRawString type, with a better name, and maybe re-design literal to account for that (and then we should also introduce ByteStringOrRawByteString).
  4. Finally, for all places that can have strings (extern ABI), we should add the requisite accessor.

But lets not overthink this and figure out 1 first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions