RosettaCodeData/Task/Extend-your-language/Seed7/extend-your-language.seed7
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

39 lines
864 B
Text

$ include "seed7_05.s7i";
$ syntax expr: .if.().().then.().else1.().else2.().else3.().end.if is -> 25;
const proc: if (in boolean: cond1) (in boolean: cond2) then
(in proc: statements1)
else1
(in proc: statements2)
else2
(in proc: statements3)
else3
(in proc: statements4)
end if is func
begin
if cond1 then
if cond2 then
statements1;
else
statements2;
end if;
elsif cond2 then
statements3;
else
statements4;
end if;
end func;
const proc: main is func
begin
if TRUE FALSE then
writeln("error TRUE TRUE");
else1
writeln("TRUE FALSE");
else2
writeln("error FALSE TRUE");
else3
writeln("error FALSE FALSE");
end if;
end func;