Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Duncan White
C-datadec
Commits
a781b586
Commit
a781b586
authored
Apr 07, 1992
by
dcw
Browse files
changed from underscore+lowercase to TypicalModula2MixedCapitalisation
JustLikeThis :-)
parent
260be3cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/mtest.mod
View file @
a781b586
...
...
@@ -9,82 +9,78 @@ FROM BIO IMPORT PutString, PutLine, PutLn;
FROM FIO IMPORT StdOut;
FROM mx IMPORT
string, intlist, intlist_null, intlist_cons,
getkind_intlist, get_intlist_cons, print_intlist,
illist, illist_null, illist_cons, getkind_illist,
get_illist_cons, print_illist,
idtree, idtree_leaf, idtree_node, getkind_idtree,
get_idtree_leaf, get_idtree_node, print_idtree;
IntList, IntListNull, IntListCons, PrintIntList,
ILList, ILListNull, ILListCons, PrintILList,
IdTree, IdTreeLeaf, IdTreeNode, PrintIdTree;
VAR
int1, int2, int3 :
i
nt
l
ist;
int1, int2, int3 :
I
nt
L
ist;
PROCEDURE test
_
intlist();
PROCEDURE testintlist();
BEGIN
int1 :=
i
nt
l
ist
_n
ull();
int2 :=
i
nt
l
ist
_c
ons( 10, int1 );
int3 :=
i
nt
l
ist
_c
ons( 20, int2 );
int1 :=
I
nt
L
ist
N
ull();
int2 :=
I
nt
L
ist
C
ons( 10, int1 );
int3 :=
I
nt
L
ist
C
ons( 20, int2 );
PutLn( "intlists:" );
PutLine();
PutString( " int1: " );
p
rint
_i
nt
l
ist( StdOut, int1 ); PutLine();
PutString( " int2: " );
p
rint
_i
nt
l
ist( StdOut, int2 ); PutLine();
PutString( " int3: " );
p
rint
_i
nt
l
ist( StdOut, int3 ); PutLine();
PutString( " int1: " );
P
rint
I
nt
L
ist( StdOut, int1 ); PutLine();
PutString( " int2: " );
P
rint
I
nt
L
ist( StdOut, int2 ); PutLine();
PutString( " int3: " );
P
rint
I
nt
L
ist( StdOut, int3 ); PutLine();
PutLine();
END test
_
intlist;
END testintlist;
PROCEDURE test
_
illist();
PROCEDURE testillist();
VAR
il1, il2, il3, il4 :
ill
ist;
il1, il2, il3, il4 :
ILL
ist;
BEGIN
il1 :=
ill
ist
_n
ull();
il2 :=
ill
ist
_c
ons( int1, il1 );
il3 :=
ill
ist
_c
ons( int2, il2 );
il4 :=
ill
ist
_c
ons( int3, il3 );
il1 :=
ILL
ist
N
ull();
il2 :=
ILL
ist
C
ons( int1, il1 );
il3 :=
ILL
ist
C
ons( int2, il2 );
il4 :=
ILL
ist
C
ons( int3, il3 );
PutLn( "
ill
ists:" );
PutLn( "
ILL
ists:" );
PutLine();
PutString( " il1: " );
p
rint
_ill
ist( StdOut, il1 ); PutLine();
PutString( " il2: " );
p
rint
_ill
ist( StdOut, il2 ); PutLine();
PutString( " il3: " );
p
rint
_ill
ist( StdOut, il3 ); PutLine();
PutString( " il4: " );
p
rint
_ill
ist( StdOut, il4 ); PutLine();
PutString( " il1: " );
P
rint
ILL
ist( StdOut, il1 ); PutLine();
PutString( " il2: " );
P
rint
ILL
ist( StdOut, il2 ); PutLine();
PutString( " il3: " );
P
rint
ILL
ist( StdOut, il3 ); PutLine();
PutString( " il4: " );
P
rint
ILL
ist( StdOut, il4 ); PutLine();
PutLine();
END test
_
illist;
END testillist;
PROCEDURE test
_
idtree();
PROCEDURE testidtree();
VAR
id1, id2, id3, id4, id5, id6 :
idt
ree;
id1, id2, id3, id4, id5, id6 :
IdT
ree;
BEGIN
id1 := idtree_leaf( "hello", int1 );
id2 := idtree_leaf( "there", int2 );
id3 := idtree_node( id1, id2 );
id4 := idtree_node( id3, id1 );
id5 := idtree_leaf( "zebedee", int3 );
id6 := idtree_node( id4, id5 );
PutLn( "idtrees:" );
id1 := IdTreeLeaf( "hello", int1 );
id2 := IdTreeLeaf( "there", int2 );
id3 := IdTreeNode( id1, id2 );
id4 := IdTreeNode( id3, id1 );
id5 := IdTreeLeaf( "zebedee", int3 );
id6 := IdTreeNode( id4, id5 );
PutLn( "idtrees:" ); PutLine();
PutString( " id1: " ); PrintIdTree( StdOut, id1 ); PutLine();
PutString( " id2: " ); PrintIdTree( StdOut, id2 ); PutLine();
PutString( " id3: " ); PrintIdTree( StdOut, id3 ); PutLine();
PutString( " id4: " ); PrintIdTree( StdOut, id4 ); PutLine();
PutString( " id5: " ); PrintIdTree( StdOut, id5 ); PutLine();
PutString( " id6: " ); PrintIdTree( StdOut, id6 ); PutLine();
PutLine();
PutString( " id1: " ); print_idtree( StdOut, id1 ); PutLine();
PutString( " id2: " ); print_idtree( StdOut, id2 ); PutLine();
PutString( " id3: " ); print_idtree( StdOut, id3 ); PutLine();
PutString( " id4: " ); print_idtree( StdOut, id4 ); PutLine();
PutString( " id5: " ); print_idtree( StdOut, id5 ); PutLine();
PutString( " id6: " ); print_idtree( StdOut, id6 ); PutLine();
PutLine();
END test_idtree;
END testidtree;
BEGIN
test
_
intlist();
test
_
illist();
test
_
idtree();
testintlist();
testillist();
testidtree();
END mtest.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment