summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog4
-rw-r--r--test/indent/modula2.mod53
2 files changed, 57 insertions, 0 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 5a5c202ad3c..3b1921c5987 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * indent/modula2.mod: New file.
+
2010-10-27 Stefan Monnier <monnier@iro.umontreal.ca>
* indent/octave.m: Add a test to ensure indentation is local.
diff --git a/test/indent/modula2.mod b/test/indent/modula2.mod
new file mode 100644
index 00000000000..f8fbcb7f4e5
--- /dev/null
+++ b/test/indent/modula2.mod
@@ -0,0 +1,53 @@
+(* -*- mode: modula-2; m2-indent:3 -*- *)
+
+IMPLEMENTATION MODULE Indent ;
+
+(* This is (* a nested comment *) *)
+// This is a single-line comment.
+
+FROM SYSTEM IMPORT ADR, TSIZE, SIZE, WORD ;
+
+CONST
+ c1 = 2;
+
+TYPE
+ t = POINTER TO ARRAY [0..10] OF LONGINT;
+
+VAR x: t;
+ y:LONGINT;
+
+
+PROCEDURE f1 (f: File) : INTEGER ;
+ VAR
+ fd: FileDescriptor ;
+ PROCEDURE foo (a:CARDINAL) : INTEGER;
+ BEGIN
+ END foo;
+BEGIN
+ IF f#Error
+ THEN
+ fd := GetIndice(FileInfo, f) ;
+ IF fd#NIL THEN
+ RETURN( fd^.unixfd )
+ ELSE
+ CASE z OF
+ 1: do1();
+ | 2: do2();
+ toto(x);
+ | 3: ;
+ | 4: do4();
+ ELSE do5();
+ END ; (* CASE selection *)
+
+ END
+ END ;
+ FormatError1('file %d has not been opened or is out of range\n', f) ;
+ RETURN( -1 )
+END f1 ;
+
+
+BEGIN
+ init
+FINALLY
+ done
+END Indent.