From ecfd5f25bfa7b5ce00b8feb83eb1deeb7009e7f7 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Thu, 5 Sep 2019 21:05:10 -0400 Subject: Add new type check files for func/proc arguments --- check/args-proc.p | 45 +++++++++++++++++++++++++++++++++++++++++++++ check/args.p | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 check/args-proc.p create mode 100644 check/args.p (limited to 'check') diff --git a/check/args-proc.p b/check/args-proc.p new file mode 100644 index 0000000..d49f932 --- /dev/null +++ b/check/args-proc.p @@ -0,0 +1,45 @@ +program main ( input, output ); + + var a, b: integer; + var x,y,z: real; + var ai :array [1..10] of integer; + + procedure bar (a, b: integer); + var test:integer; + begin + test := 2; + a := 2 + end; + procedure bar1 (a, b: real); + var test:integer; + begin + test := 2; + a := 2.0 + end; + procedure bar2 (a: real); + var test:integer; + begin + test := 2; + a := 2.0 + end; + procedure bar3 (a, b, c, d, e, f, g: integer); + var test:integer; + begin + test := 2; + a := 2 + end; + procedure bar4 (a, b, c, d: real; e, f, g: integer); + var test:integer; + begin + test := 2; + a := 2.0; + e := 2 + end; +begin +{ TEST } + + a := 1; + x := 3.14; + b := a + 35 + (* test *) +end. diff --git a/check/args.p b/check/args.p new file mode 100644 index 0000000..358dc7c --- /dev/null +++ b/check/args.p @@ -0,0 +1,45 @@ +program main ( input, output ); + + var a, b: integer; + var x,y,z: real; + var ai :array [1..10] of integer; + + function bar (a, b: integer) : real; + var test:integer; + begin + test := 2; + a := 2 + end; + function bar1 (a, b: real) : real; + var test:integer; + begin + test := 2; + a := 2.0 + end; + function bar2 (a: real) : real; + var test:integer; + begin + test := 2; + a := 2.0 + end; + function bar3 (a, b, c, d, e, f, g: integer) : real; + var test:integer; + begin + test := 2; + a := 2 + end; + function bar4 (a, b, c, d: real; e, f, g: integer) : real; + var test:integer; + begin + test := 2; + a := 2.0; + e := 2 + end; +begin +{ TEST } + + a := 1; + x := 3.14; + b := a + 35 + (* test *) +end. -- cgit v1.1