Skip to content
Snippets Groups Projects
Commit 868000c6 authored by Wilma Krutrök's avatar Wilma Krutrök
Browse files

Update HOME_EXAM.md

parent 96c2c2a1
No related branches found
No related tags found
No related merge requests found
...@@ -606,9 +606,9 @@ fn main() -> () { ...@@ -606,9 +606,9 @@ fn main() -> () {
``` ```
```rust ```rust
fn b(z: &mut i32, w: &mut i32) -> () { fn b(x: &mut i32, y: &mut i32) -> () {
*z = *z + 1; *x = *x + 1;
*w = *w + 1; *y = *y + 1;
}; };
fn main() -> () { fn main() -> () {
let mut x: i32 = 5; let mut x: i32 = 5;
...@@ -634,6 +634,8 @@ The borrowchecker should make sure that: ...@@ -634,6 +634,8 @@ The borrowchecker should make sure that:
This ensures that a variable can not be changed at the same time that another reference tries to read it. This ensures that a variable can not be changed at the same time that another reference tries to read it.
The implementation of the borrow checking is not compleated. It is possible to make references and change the value via the reference. The interpreter does currently not reject illeagal borrows.
## Conclusion ## Conclusion
It has been very interesting to learn how a programming language is built. From the lexical analysing where sentences are parsed into tokens to the syntax analysing where the order of the tokens are ckecked. I found it very interesting and instructive to be able to build the AST and parser with the use of lalrpop. It was tricky to understand what should be done in the beginning when both learing lalrpop and rust at the same time. This fell inte place with time and after rewriting the AST compleatly it made alot more sense. It has been very interesting to learn how a programming language is built. From the lexical analysing where sentences are parsed into tokens to the syntax analysing where the order of the tokens are ckecked. I found it very interesting and instructive to be able to build the AST and parser with the use of lalrpop. It was tricky to understand what should be done in the beginning when both learing lalrpop and rust at the same time. This fell inte place with time and after rewriting the AST compleatly it made alot more sense.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment