diff --git a/src/language/syntax.md b/src/language/syntax.md index 06e2891..317173b 100644 --- a/src/language/syntax.md +++ b/src/language/syntax.md @@ -9,7 +9,9 @@ i ::= array!(t, μ, n) Array type declaration where n is a natural num | type t = struct([μ]+) Struct declaration (without named fields) | const x: μ = e Constant declaration | use crate::* External crate import + | use mod::* Internal module import d ::= x: τ Function argument + | mut x: τ Mutable function argument μ ::= unit|bool|u8|U8|i8|I8... Base types | Seq<μ> Sequence | String Strings @@ -26,8 +28,8 @@ p ::= x Variable pattern s ::= let p: τ = e Let binding | let mut p: τ = e Mutable let binding | x = e Variable reassignment - | x = e? Variable reassignment with error catching - | let p: τ = e? Let binding with error catching + | x = e? Variable reassignment with result/option catching + | let p: τ = e? Let binding with result/option catching | if e then b (else b) Conditional statements | c(e) Enum injection | match e { [c(p) => e]+ } Pattern matching @@ -36,6 +38,7 @@ s ::= let p: τ = e Let binding | b Statement block e ::= ()|true|false Unit and boolean literals | n Integer literal + | U8(e)|I8(e)|... Secret integer classification | "..." String literal | t([e]+) Array literal | e as μ Integer casting