chiark / gitweb /
Various, style: Generally prefer `: ' over ` : '.
[sod] / test / test.sod
index 776228b11d4770cecc872e02f6980e5e006ab493..192f631713f06369f4694e8c7b5b681178fb97a7 100644 (file)
@@ -1,10 +1,10 @@
 /* -*-sod-*- */
 
-code h : includes {
+code h: includes {
 #include "sod.h"
 }
 
-code c : includes {
+code c: includes {
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -12,7 +12,7 @@ code c : includes {
 #include "test.h"
 }
 
-code c : early_user {
+code c: early_user {
 /*----- Preliminary definitions -------------------------------------------*/
 
 /* Confuse the fragment scanner... */
@@ -44,7 +44,7 @@ static void done(int q, const char *where) { step(q, where); }
 
 }
 
-code c : (tests head)
+code c: (tests head)
   [user (tests head) tests (tests tail) main (user end)]
 {
 /*----- Test machinery ----------------------------------------------------*/
@@ -52,12 +52,12 @@ code c : (tests head)
 static void tests(void)
 LBRACE
 }
-code c : (tests tail) {
+code c: (tests tail) {
 RBRACE
 
 }
 
-code c : main {
+code c: main {
 /*----- Main program ------------------------------------------------------*/
 
 int main(void)
@@ -70,7 +70,7 @@ int main(void)
 
 /*----- Various kinds of method combinations ------------------------------*/
 
-code h : early_user {
+code h: early_user {
 struct item {
   struct item *next;
   const char *p;
@@ -78,7 +78,7 @@ struct item {
 
 }
 
-code c : early_user {
+code c: early_user {
 static void *xmalloc(size_t n)
 {
   void *p = malloc(n);
@@ -136,7 +136,7 @@ static int check_vec(struct vec *v, ...)
 }
 
 [link = SodObject, nick = t1base]
-class T1Base : SodObject {
+class T1Base: SodObject {
   [combination = progn] void aprogn() { STEP(1); }
   [combination = sum] int asum() { return 1; }
   [combination = and] int aand() { return 8; }
@@ -158,7 +158,7 @@ class T1Base : SodObject {
 }
 
 [link = T1Base, nick = t1sub]
-class T1Sub : T1Base {
+class T1Sub: T1Base {
   void t1base.aprogn() { STEP(0); }
   int t1base.asum() { return 2; }
   int t1base.aand() { return 6; }
@@ -167,7 +167,7 @@ class T1Sub : T1Base {
   int t1base.avec() { return 4; }
 }
 
-code c : tests {
+code c: tests {
   prepare("aggregate, base");
   { SOD_DECL(T1Base, t1, NO_KWARGS);
     struct item *l;
@@ -205,14 +205,14 @@ code c : tests {
 /*----- Slot and user initargs --------------------------------------------*/
 
 [link = SodObject, nick = t2]
-class T2 : SodObject {
+class T2: SodObject {
   [initarg = x] int x = 0;
 
   initarg int y = 1;
   init { if (!y) STEP(0); }
 }
 
-code c : tests {
+code c: tests {
   prepare("initargs, defaults");
   { SOD_DECL(T2, t, NO_KWARGS);
     if (t->t2.x == 0) STEP(0);
@@ -228,24 +228,24 @@ code c : tests {
 /*----- Keyword argument propagation --------------------------------------*/
 
 [link = SodObject, nick = base]
-class T3Base : SodObject {
+class T3Base: SodObject {
   void m0(?int x) { STEP(x); }
   void m1(?) { }
 }
 
 [link = T3Base, nick = mid]
-class T3Mid : T3Base {
+class T3Mid: T3Base {
   void base.m0(?int y) { STEP(y); CALL_NEXT_METHOD; }
   void base.m1(?) { STEP(4); CALL_NEXT_METHOD; }
 }
 
 [link = T3Mid, nick = sub]
-class T3Sub : T3Mid {
+class T3Sub: T3Mid {
   void base.m0(?int z) { STEP(z); CALL_NEXT_METHOD; }
   void base.m1(?int z) { STEP(z); CALL_NEXT_METHOD; }
 }
 
-code c : tests {
+code c: tests {
   prepare("kwargs");
   { SOD_DECL(T3Sub, t, NO_KWARGS);
     T3Base_m0(t, KWARGS(K(z, 0) K(y, 1) K(x, 2)));