chiark / gitweb /
Various, style: Generally prefer `: ' over ` : '.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 2 Aug 2017 09:29:28 +0000 (10:29 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2018 18:58:40 +0000 (19:58 +0100)
Before subclass lists, output constraints, and bitfield widths.  Retain
` : ' in conditional expressions to match ` ? ' which I don't want to
change, at least for now.

doc/structures.tex
doc/syntax.tex
doc/tutorial.tex
lib/keyword.h
src/builtin.lisp
src/class-output.lisp
test/chimaera.sod
test/test.sod

index 7cc825acbd8308b2fbce00bbd8de0b4998ebd256..c5c221912dc9840b7e4f1d88be9ac221468b673d 100644 (file)
@@ -201,7 +201,7 @@ recommended.
 
 \begin{describe}[SodClass]{cls}
     {[nick = cls, link = SodObject]                             \\
-     class SodClass : SodObject \{                              \\ \ind
+     class SodClass: SodObject \{                               \\ \ind
        const char *name;                                        \\
        const char *nick;                                        \\
        size_t initsz;                                           \\
index 18b46e176e64852ad2ad3ca01200cdbc751ee18a..c6033cf3cd53fdcdb154e83b67a55c6cfd1d8c7c 100644 (file)
@@ -540,11 +540,11 @@ necessary in order to resolve certain kinds of circularity.  For example,
 \begin{prog}
 class Sub;                                                      \\+
 
-class Super : SodObject \{                                      \\ \ind
+class Super: SodObject \{                                       \\ \ind
   Sub *sub;                                                   \-\\
 \};                                                             \\+
 
-class Sub : Super \{                                            \\ \ind
+class Sub: Super \{                                             \\ \ind
   /* \dots\ */                                                \-\\
 \};
 \end{prog}
@@ -625,14 +625,14 @@ An @<initializer>, if present, is treated as if a separate
 For example,
 \begin{prog}
 [nick = eg]                                                     \\
-class Example : Super \{                                        \\ \ind
+class Example: Super \{                                         \\ \ind
   int foo = 17;                                               \-\\
 \};
 \end{prog}
 means the same as
 \begin{prog}
 [nick = eg]                                                     \\
-class Example : Super \{                                        \\ \ind
+class Example: Super \{                                         \\ \ind
   int foo;                                                      \\
   eg.foo = 17;                                                \-\\
 \};
index ac38e06c3379c4ea85030162224357ee34ecaf4f..3d90293169f700b198654598248cedcb02e9ddcc 100644 (file)
@@ -111,16 +111,16 @@ The following is a simple Sod input file.
 \begin{prog}
   /* -*-sod-*- */                                               \\+
 
-  code c : includes \{                                          \\
+  code c: includes \{                                           \\
   \#include "greeter.h"                                         \\
   \}                                                            \\+
 
-  code h : includes \{                                          \\
+  code h: includes \{                                           \\
   \#include <stdio.h>                                           \\
   \#include <sod/sod.h>                                         \\
   \}                                                            \\+
 
-  class Greeter : SodObject \{                                  \\ \ind
+  class Greeter: SodObject \{                                   \\ \ind
     void greet(FILE *fp) \{                                     \\ \ind
       fputs("Hello, world!\textbackslash n", fp);             \-\\
     \}                                                        \-\\
@@ -175,7 +175,7 @@ approach to all of this: it expects you, the programmer, to deal with it.
 
 The basic syntax for @"code" stanzas is
 \begin{prog}
-  code @<file-label> : @<section> \{                            \\ \ind
+  code @<file-label>: @<section> \{                             \\ \ind
     @<code>                                                   \-\\
   \}
 \end{prog}
index 783f0b70d0b50f052fce8e8a145f51bb6d861dc0..432fbd1719909e99b432a4d2927f5adfc15b5564 100644 (file)
@@ -235,7 +235,7 @@ extern kw_unkhookfn *kw_unkhook;
     set##_KWSET(KWSET__SUPPLIEDP)                                      \
     set##_KWSET(KWSET__STRUCTMEM)                                      \
   }
-#define KWSET__SUPPLIEDP(type, name, dflt) unsigned name##_suppliedp : 1;
+#define KWSET__SUPPLIEDP(type, name, dflt) unsigned name##_suppliedp: 1;
 #define KWSET__STRUCTMEM(type, name, dflt) type name;
 
 /* --- @KWSET_PARSEFN@ --- *
index 0787b8dec7ccee1ef79a47a86899f4172e1bcfbb..c10e5ad51d8a478c3a12135d03b4a50b212f8843 100644 (file)
@@ -279,7 +279,7 @@           (default (sod-initarg-default initarg)))
 
 (definst suppliedp-struct (stream) (flags var)
   (format stream
-         "~@<struct { ~2I~_~{unsigned ~A : 1;~^ ~_~} ~I~_} ~A;~:>"
+         "~@<struct { ~2I~_~{unsigned ~A: 1;~^ ~_~} ~I~_} ~A;~:>"
          flags var))
 
 ;; Initialization.
index 2d1c222635d945b94911f39b5a69e68c718a3d5f..806de356886f423dbab797e68fe925970b1bfd35 100644 (file)
@@ -299,7 +299,7 @@ (defmethod hook-output progn
                         (c-function-keywords type))))
         (when keys
           (format stream "struct ~A {~%~
-                          ~{  unsigned ~A : 1;~%~}~
+                          ~{  unsigned ~A: 1;~%~}~
                           };~2%"
                   (direct-method-suppliedp-struct-tag method)
                   (mapcar #'argument-name keys))))))))
@@ -511,7 +511,7 @@ (defmethod hook-output progn
                                  class)
           (format stream "~&struct ~A {~%"
                   (effective-method-keyword-struct-tag method))
-          (format stream "~{  unsigned ~A__suppliedp : 1;~%~}"
+          (format stream "~{  unsigned ~A__suppliedp: 1;~%~}"
                   (mapcar #'argument-name keys))
           (dolist (key keys)
             (write-string "  " stream)
index 976c727e578e25c5e440bbbfd3e9f608f053ef64..b30248cf09c9be01b074c954a510f2d9058e77b3 100644 (file)
@@ -3,34 +3,34 @@
  * A simple SOD module for testing.
  */
 
-code c : includes {
+code c: includes {
 #include <stdio.h>
 #include "chimaera.h"
 }
 
-code h : includes {
+code h: includes {
 #include "sod.h"
 }
 
 [nick = nml, link = SodObject]
-class Animal : SodObject {
+class Animal: SodObject {
   int tickles = 0;
 
   [combination = progn] void tickle();
   [role = before] void nml.tickle() { me->nml.tickles++; }
 }
 
-class Lion : Animal {
+class Lion: Animal {
   void bite() { puts("Munch!"); }
   void nml.tickle() { Lion_bite(me); }
 }
 
-class Goat : Animal {
+class Goat: Animal {
   void butt() { puts("Bonk!"); }
   void nml.tickle() { Goat_butt(me); }
 }
 
-class Serpent : Animal {
+class Serpent: Animal {
   int limit = 2;
 
   void hiss() { puts("Sssss!"); }
@@ -44,11 +44,11 @@ class Serpent : Animal {
 }
 
 [nick = sir, link = Animal]
-class Chimaera : Lion, Goat, Serpent {
+class Chimaera: Lion, Goat, Serpent {
   serpent.limit = 1;
 }
 
-code c : user {
+code c: user {
 /*----- Main driver code --------------------------------------------------*/
 
 static void tickle_animal(Animal *a)
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)));