Skip to content

Commit

Permalink
Fix grammar style
Browse files Browse the repository at this point in the history
  • Loading branch information
francescoo22 committed Aug 30, 2024
1 parent 9590bfe commit c5af6ba
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
35 changes: 20 additions & 15 deletions chapters/5-Annotation-System.typ
Original file line number Diff line number Diff line change
Expand Up @@ -607,11 +607,16 @@ After defining how to type a _call_, it is easy to formalize the typing of a _ca
get_shared(): shared { ... }
f(): unique {
begin_f; // (Δ = ∅)
var x; // (Δ = x: T)
var y; // (Δ = x: T, y: T)
x = get_unique(); // (Δ = x: unique, y: T)
y = get_shared(); // (Δ = x: unique, y: shared)
begin_f;
⊣ Δ = ∅
var x;
⊣ Δ = x: T
var y;
⊣ Δ = x: T, y: T
x = get_unique();
⊣ Δ = x: unique, y: T
y = get_shared();
⊣ Δ = x: unique, y: shared
...
}
```
Expand Down Expand Up @@ -793,32 +798,32 @@ The system does not permit returning a null value or a method call directly sinc
fun push(this: unique ♭, value: unique): shared {
begin_push;
// Δ = this: unique ♭, value: unique
Δ = this: unique ♭, value: unique
var r;
// Δ = this: unique ♭, value: unique, r: T
Δ = this: unique ♭, value: unique, r: T
r = this.root;
// Δ = this: unique ♭, value: unique, r: unique, this.root: T
Δ = this: unique ♭, value: unique, r: unique, this.root: T
this.root = Node(value, r);
// Δ = this: unique ♭, value: T, r: T, this.root: unique
Δ = this: unique ♭, value: T, r: T, this.root: unique
return Unit();
}
fun pop(this: unique ♭): unique {
begin_pop;
// Δ = this: unique ♭
Δ = this: unique ♭
var value;
// Δ = this: unique ♭, value: T
Δ = this: unique ♭, value: T
if (this.root == null) {
value = null;
// Δ = this: unique ♭, value: unique
Δ = this: unique ♭, value: unique
} else {
value = this.root.value;
// Δ = this: unique ♭, value: unique, this.root.value: T
Δ = this: unique ♭, value: unique, this.root.value: T
this.root = this.root.next;
// Δ = this: unique ♭, value: unique, this.root: unique
Δ = this: unique ♭, value: unique, this.root: unique
}
// Unification...
// Δ = this: unique ♭, value: unique, this.root: unique
Δ = this: unique ♭, value: unique, this.root: unique
return value;
}
```
Expand Down
12 changes: 11 additions & 1 deletion config/thesis-config.typ
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@
show regex("//.*"): set text(rgb("#8a8a8a"))

r
}
}

#let grammar-show() = r => {
show regex("//.*"): set text(rgb("#9a9a5b"))
show regex("⊣.*"): set text(rgb("#8a8a8a"))

r
}


#let config(
myAuthor: "Nome cognome",
Expand Down Expand Up @@ -104,6 +112,8 @@

show raw.where(lang: "vpr"): vpr-show()

show raw.where(lang: none): grammar-show()

show par: set block(spacing: 0.55em)
show heading: set block(above: 1.4em, below: 1em)

Expand Down

0 comments on commit c5af6ba

Please sign in to comment.