From 521e412db2ed34af53f349604f069ac52ae84cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind?= Date: Sun, 3 Apr 2022 22:40:33 +0200 Subject: [PATCH] Added files to debug acoss ps --- exercises/05/vslc/vsl_programs/ps2-parser/function_call.vsl | 1 + .../05/vslc/vsl_programs/ps3-simplify/function_call.vsl | 4 ++-- exercises/05/vslc/vsl_programs/ps3-simplify/lists.vsl | 6 +++++- exercises/05/vslc/vsl_programs/ps4-symtab/lists.vsl | 2 ++ exercises/05/vslc/vsl_programs/ps4-symtab/shadow.vsl | 3 +++ exercises/05/vslc/vsl_programs/ps5-codegen1/lists.vsl | 6 +++++- 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/exercises/05/vslc/vsl_programs/ps2-parser/function_call.vsl b/exercises/05/vslc/vsl_programs/ps2-parser/function_call.vsl index 90370c7..b835c48 100644 --- a/exercises/05/vslc/vsl_programs/ps2-parser/function_call.vsl +++ b/exercises/05/vslc/vsl_programs/ps2-parser/function_call.vsl @@ -1,4 +1,5 @@ func add(a, b) begin + a := -a return a + b end diff --git a/exercises/05/vslc/vsl_programs/ps3-simplify/function_call.vsl b/exercises/05/vslc/vsl_programs/ps3-simplify/function_call.vsl index 90370c7..33b2a27 100644 --- a/exercises/05/vslc/vsl_programs/ps3-simplify/function_call.vsl +++ b/exercises/05/vslc/vsl_programs/ps3-simplify/function_call.vsl @@ -1,9 +1,9 @@ -func add(a, b) begin +func add(a, b, c) begin return a + b end func main() begin - print add(40, 2) + print add(40, 2, 4) return 0 end \ No newline at end of file diff --git a/exercises/05/vslc/vsl_programs/ps3-simplify/lists.vsl b/exercises/05/vslc/vsl_programs/ps3-simplify/lists.vsl index 947fcaa..8e2aacb 100644 --- a/exercises/05/vslc/vsl_programs/ps3-simplify/lists.vsl +++ b/exercises/05/vslc/vsl_programs/ps3-simplify/lists.vsl @@ -2,7 +2,11 @@ func my_func(a, b, c, d, e, f, g, h) begin var i, j, k, l, m - i := a + b + d + + + i := a + ~(i + 4) + + i := a + (b + d) * (3 + b) if i = f then begin print "hmmm" diff --git a/exercises/05/vslc/vsl_programs/ps4-symtab/lists.vsl b/exercises/05/vslc/vsl_programs/ps4-symtab/lists.vsl index 947fcaa..08702f6 100644 --- a/exercises/05/vslc/vsl_programs/ps4-symtab/lists.vsl +++ b/exercises/05/vslc/vsl_programs/ps4-symtab/lists.vsl @@ -2,6 +2,8 @@ func my_func(a, b, c, d, e, f, g, h) begin var i, j, k, l, m + i := --i + i := a + b + d if i = f then begin diff --git a/exercises/05/vslc/vsl_programs/ps4-symtab/shadow.vsl b/exercises/05/vslc/vsl_programs/ps4-symtab/shadow.vsl index e4193ce..c2e882b 100644 --- a/exercises/05/vslc/vsl_programs/ps4-symtab/shadow.vsl +++ b/exercises/05/vslc/vsl_programs/ps4-symtab/shadow.vsl @@ -1,4 +1,7 @@ // Checking symbol shadowing + +var a + func shadow() begin var a, b a := 1 diff --git a/exercises/05/vslc/vsl_programs/ps5-codegen1/lists.vsl b/exercises/05/vslc/vsl_programs/ps5-codegen1/lists.vsl index 947fcaa..de2dff1 100644 --- a/exercises/05/vslc/vsl_programs/ps5-codegen1/lists.vsl +++ b/exercises/05/vslc/vsl_programs/ps5-codegen1/lists.vsl @@ -2,7 +2,10 @@ func my_func(a, b, c, d, e, f, g, h) begin var i, j, k, l, m - i := a + b + d + + i := a + ~(i + 4) + + i := a + (b + d) * (3 + b) if i = f then begin print "hmmm" @@ -14,5 +17,6 @@ func main() begin var n, o, p, q, r, s, t, u, v, w n := 5 n += my_func(1, 2, 3, 5, 8, 13, 21, 34) + print n return 0 end \ No newline at end of file