chiark / gitweb /
Slightly re-organise comments around feature definitions
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 30 Jan 2026 00:40:05 +0000 (00:40 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Fri, 30 Jan 2026 00:40:05 +0000 (00:40 +0000)
I was just looking at the code and finding it confusing.  Maybe more
comments will help, but maybe generating XML with enormous piles of
preprocessory is intrinsically confusing.

bedstead.c

index a050b7d9ae88762d12e41f54fd820a9e979caaf7..63df6e9ba68b6f7d6a7fc629dcea8d14f8dbb6fc 100644 (file)
@@ -3082,6 +3082,9 @@ static struct alt_sub_override {
  * Define all the Character Variant features using X macros.  These
  * are then used to create 'cvXX' features and grouped into 'ssXX'
  * features.
+ *
+ * Where possible, Character Variant features have numbers that are 32
+ * less than the ASCII code of the base character.
  */
 #define CV07(V) V("quotesingle", ".curly")
 #define CV12(V) V("comma", ".left")
@@ -3182,6 +3185,10 @@ static struct gsub_feature {
 #define SUFFIXSUB1(base, suffix1, ...) SUB(base, base suffix1)
 #define SUFFIXSUB2(base, suffix1, suffix2, ...) SUB(base, base suffix2)
 #define SINGLESUB(x) "<SingleSubst>\n" x "</SingleSubst>\n"
+       /*
+        * Each stylistic set is defined as a set of character variant
+        * feature values using the CVxx() macros defined above.
+        */
        { "ss01", SCRIPT_ALL, .name = "SAA5051",
          .xml = SINGLESUB(CV07(SUFFIXSUB1) CV12(SUFFIXSUB1)
                           CV14(SUFFIXSUB1) CV26(SUFFIXSUB1)
@@ -3214,8 +3221,8 @@ static struct gsub_feature {
 #define CV3(base, a, b) CROSSALT3(base, base a, base b)
 #define CV(...) GET_MACRO(__VA_ARGS__, CV3, CV2)(__VA_ARGS__)
        /*
-        * Where possible, Character Variant features have numbers
-        * that are 32 less than the ASCII code of the base character.
+        * These construct the character-variant features out of the
+        * CVxx() macros above.
         */
        { "cv07", SCRIPT_ALL, .name = "apostrophe variants",
          .subnames = { "straight", "curly" },