diff options
| author | Nagi5Yeq <wu@x-nagi.com> | 2020-05-30 02:33:00 +0800 |
|---|---|---|
| committer | Nagi5Yeq <wu@x-nagi.com> | 2020-05-30 02:33:00 +0800 |
| commit | 63d2a1c552b0d190a0131c2db2045d154b9ec138 (patch) | |
| tree | 9cd8addea1f49355ec2ecb7669daf12dd4ee61a2 /t | |
| parent | 56d68765016fc7aa68fe7b522de5e84c7a12123a (diff) | |
support for break, continue and void type
Diffstat (limited to 't')
| -rw-r--r-- | t/trivial.pas | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/t/trivial.pas b/t/trivial.pas index c537cf1..dd98fad 100644 --- a/t/trivial.pas +++ b/t/trivial.pas @@ -67,10 +67,11 @@ end; function branch_test(a:integer):integer; var - b,c:integer; + b,c,d:integer; begin b:=3; c:=0; + d:=4; if a<b then c:=-1 else @@ -78,11 +79,31 @@ begin c:=1; while b>0 do begin - a:=a*b; + while d>0 do + begin + d:=d-1; + if d=3 then + begin + d:=2; + break + end; + a:=a*d+b; + end; b:=b-1 end; repeat begin + repeat + begin + d:=d+1; + if d=3 then + begin + d:=4; + continue; + end; + a:=a*c+d; + end + until d>5; a:=a*c; b:=b+1 end @@ -114,3 +135,9 @@ function name_test():boolean; begin name_test:=name_test_global()<>name_test_local() end; + +function void_test():void; +var + a,b:^void; +begin +end; |
