From a5f3f870d086d390faf6ddc4c22ee4ea97a87514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wilma=20Krutr=C3=B6k?= <wilkru-7@student.ltu.se> Date: Sun, 25 Oct 2020 10:51:51 +0000 Subject: [PATCH] Added coverage and future implementation bullets --- HOME_EXAM.md | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/HOME_EXAM.md b/HOME_EXAM.md index 366270e..3ae643b 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 -- GitLab