Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow ident name start with _ #278

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

Ggiggle
Copy link
Contributor

@Ggiggle Ggiggle commented Oct 25, 2024

Motivation

The rust name can start with "_", so we should remove this strict for idl parser.

enum _Enum {
    _1 = 1,
    _2 = 2
}

codegen should be

impl _Enum {
            pub const _1: Self = Self(1);
            pub const _2: Self = Self(2);

            pub fn inner(&self) -> i32 {
                self.0
            }
    ...
}

Solution

Keep the starting '_'* for idl item name.

@Ggiggle Ggiggle requested review from a team as code owners October 25, 2024 05:09
@Ggiggle Ggiggle merged commit c0dfa51 into main Oct 25, 2024
11 checks passed
@Ggiggle Ggiggle deleted the fix/allow_ident_naming_by_underline branch October 25, 2024 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants