File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -2871,13 +2871,16 @@ trait ToMoonBitIdent: ToOwned {
2871
2871
2872
2872
impl ToMoonBitIdent for str {
2873
2873
fn to_moonbit_ident ( & self ) -> String {
2874
- // Escape MoonBit keywords
2874
+ // Escape MoonBit keywords and reserved keywords
2875
2875
match self {
2876
- "continue" | "for" | "match" | "if" | "pub" | "priv" | "readonly" | "break"
2877
- | "raise" | "try" | "except" | "catch" | "else" | "enum" | "struct" | "type"
2878
- | "trait" | "return" | "let" | "mut" | "while" | "loop" | "extern" | "with"
2879
- | "throw" | "init" | "main" | "test" | "in" | "guard" | "typealias" | "const"
2880
- | "method" | "move" | "do" | "static" | "final" => {
2876
+ "module" | "move" | "ref" | "static" | "super" | "unsafe" | "use" | "where"
2877
+ | "await" | "dyn" | "abstract" | "do" | "final" | "macro" | "override" | "typeof"
2878
+ | "virtual" | "yield" | "local" | "method" | "alias" | "assert" | "as" | "else"
2879
+ | "extern" | "fn" | "if" | "let" | "const" | "match" | "mut" | "type" | "typealias"
2880
+ | "struct" | "enum" | "trait" | "traitalias" | "derive" | "while" | "break"
2881
+ | "continue" | "import" | "return" | "throw" | "raise" | "try" | "catch" | "pub"
2882
+ | "priv" | "readonly" | "true" | "false" | "_" | "test" | "loop" | "for" | "in"
2883
+ | "impl" | "with" | "guard" | "async" | "is" | "init" | "main" => {
2881
2884
format ! ( "{self}_" )
2882
2885
}
2883
2886
_ => self . to_snake_case ( ) ,
You can’t perform that action at this time.
0 commit comments