Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Fix trailing issues #4

Description

@Gipson62
    DefaultSystem {
        number: true,
        symbol: true,
        keyword: true,
        string: true,
        whitespace: {
            allow_them: false,
            use_system: true,
        },
    },
    Number {
        trailing {
            "_int"   => i64  => INT,
            "_uint"  => u64 => UINT,
            "_float" => f64  => FLOAT
        },
        float: true,
        u_int: true,
        int: true
    }

Both the DefaultSystem and the Number conflicts with each other, Int, UInt & Float are already defined within the DefaultSystem, so when you want to add trailing for those types it conflicts because of:

error[E0004]: non-exhaustive patterns: `&lexer::Literal::Int(_)` and `&lexer::Literal::Float(_)` not covered
  --> atlas_frontend\src\lexer\mod.rs:3:1
   |
3  | / lexer_builder! {
4  | |     DefaultSystem {
5  | |         number: true,
6  | |         symbol: true,
...  |
62 | |     },
63 | | }
   | |_^ patterns `&lexer::Literal::Int(_)` and `&lexer::Literal::Float(_)` not covered
   |
note: `lexer::Literal` defined here
  --> atlas_frontend\src\lexer\mod.rs:3:1
   |
3  | / lexer_builder! {
4  | |     DefaultSystem {
5  | |         number: true,
6  | |         symbol: true,
...  |
55 | |             "_int"   => i64  => Int,
   | |                                 --- not covered
...  |
62 | |     },
63 | | }
   | | ^
   | |_|
   |   not covered
   = note: the matched value is of type `&lexer::Literal`
   = note: this error originates in the derive macro `Debug` which comes from the expansion of the macro `lexer_builder` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions