cli: add recoverable endian APIs and qualified std enums

This commit is contained in:
dev committed 2026-10-06 15:12:55 +03:00
1 parent 10a370471b
commit a2ca293506
45 files changed
+1205 -89

No files matched your search

+3 -3
View File
@@ -28,7 +28,7 @@ fn_decl = "fn" ident "(" [ param { "," param } ] ")" "->" type [ "from" id
block ; (* `trusted` is reserved and rejected, E7006 *)
param = ident ":" type ;
type = int_type | "bool" | "void" | "never" | ident
type = int_type | "bool" | "void" | "never" | path
| "[" type ";" int_lit "]"
| wrapper "<" type ">"
| "cap" "<" path ">"
@@ -64,7 +64,7 @@ if_expr = "if" expr block [ "else" ( if_expr | block ) ] ;
match_expr = "match" expr "{" { arm } "}" ;
arm = pattern "=>" ( block | expr "," ) ;
pattern = "_" | int_lit (* integer matches only; `_` is required there *)
| ident "::" ident [ "(" ident { "," ident } ")" ] (* enum variant: Shape::Rect(w, h); no `_` in enum matches *)
| path "::" ident [ "(" ident { "," ident } ")" ] (* enum variant: Shape::Rect(w, h); no `_` in enum matches *)
| ident [ "(" ident { "," ident } ")" ] ; (* outcome of a fallible operation: ok(n), closed *)
select_stmt = "select" "{" { select_arm } "cancelled" [ "(" ident { "," ident } ")" ] "=>" ( block | expr "," ) "}" ;
@@ -89,7 +89,7 @@ member = ident | keyword ; (* after `.` a keyword is
call_args = [ "<" type ">" ] "(" [ expr { "," expr } ] ")" ;
primary = int_lit | "true" | "false" | string
| ident [ "{" field_init { "," field_init } [ "," ] "}" ] (* struct literal *)
| ident "::" ident (* enum variant; applied by a call *)
| path "::" ident (* enum variant; applied by a call *)
| "[" expr ";" int_lit "]"
| "(" expr ")"
| if_expr | match_expr | block ;