Skip to content

Commit

Permalink
fix(moonbit): add more reserved words
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-jerry-ye committed Oct 28, 2024
1 parent 900de82 commit db327a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/moonbit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ impl ToMoonBitIdent for str {
"continue" | "for" | "match" | "if" | "pub" | "priv" | "readonly" | "break"
| "raise" | "try" | "except" | "catch" | "else" | "enum" | "struct" | "type"
| "trait" | "return" | "let" | "mut" | "while" | "loop" | "extern" | "with"
| "throw" | "init" | "main" | "test" | "in" | "guard" => {
| "throw" | "init" | "main" | "test" | "in" | "guard" | "typealias" => {
format!("{self}_")
}
_ => self.to_snake_case(),
Expand All @@ -2802,7 +2802,7 @@ impl ToMoonBitTypeIdent for str {
match self.to_upper_camel_case().as_str() {
type_name @ ("Bool" | "Byte" | "Int" | "Int64" | "UInt" | "UInt64" | "Float"
| "Double" | "Error" | "Buffer" | "Bytes" | "Array" | "FixedArray"
| "Map" | "String" | "Option" | "Result" | "Char") => {
| "Map" | "String" | "Option" | "Result" | "Char" | "Json") => {
format!("{type_name}_")
}
type_name => type_name.to_owned(),
Expand Down

0 comments on commit db327a9

Please sign in to comment.