diff --git a/HOME_EXAM.md b/HOME_EXAM.md index 366270e04f7377cf0e47a570d52d08be738de906..3ae643b10afc9b24aab0616f0425ab2db88bf124 100644 --- a/HOME_EXAM.md +++ b/HOME_EXAM.md @@ -78,7 +78,7 @@ In the following sections will the bullet points above be covered. The answers w ## Syntax The implemented langugage is desciribed usign EBNF grammar below. The language is implemented using lalrpop. Note that "?" means optional and when a part ends with "s" for example "programs" is it a vector containing one or more program (same as program+). - +#### EBNF ```ebnf Program :Programs @@ -225,10 +225,35 @@ Bool ; ``` -Showcase +#### Showcase ```rust ``` + +#### Coverage +- Two different function definitions (with arguments and return type or without arguments and return type) +- Let and mutable let +- Assignments +- Functioncalls +- If with or without else +- While +- Expressions +- Types: bool, i32 and unit + +All statements have explicit types. + +#### Future implementation +- Function definition with arguments but no return type or no arguments but return type +- Else if +- Other loops than while +- More types +- Nested functions +- Functions not needed to be decleared in specific order +- Global assignments +- Shadowing + +Currently it is needed to seperate statements with ";" (except for the last one) for the parser to interpret it as a vector. This would be nice to rewrite in the future. + ## Semantics ## Type checker