]> git.cameronkatri.com Git - mandoc.git/blobdiff - chars.in
Make the character table available to libroff so it can check the
[mandoc.git] / chars.in
index 5db0756650dcdb2b36a7ea46523c491817ef5dd7..d902e1a23a921a82369fb12deb8a77263ff331b9 100644 (file)
--- a/chars.in
+++ b/chars.in
@@ -1,6 +1,7 @@
-/*     $Id: chars.in,v 1.32 2010/07/31 23:52:58 schwarze Exp $ */
+/*     $Id: chars.in,v 1.47 2014/10/28 02:43:59 schwarze Exp $ */
 /*
- * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
  */
 
 /*
- * The ASCII translation tables.  STRING corresponds to predefined
- * strings (cf. mdoc_samples.7 and tmac/mdoc/doc-nroff).  CHAR
- * corresponds to special characters (cf. groff_char.7).  BOTH contains
- * sequences that are equivalent in both STRING and CHAR.
+ * The ASCII translation tables.
  *
- * Either way, the left-hand side corresponds to the input sequence (\x,
- * \(xx, \*(xx and so on) whose length is listed second element.  The
- * right-hand side is what's produced by the front-end, with the fourth
- * element being its length.
+ * The left-hand side corresponds to the input sequence (\x, \(xx, \*(xx
+ * and so on) whose length is listed second element.  The right-hand
+ * side is what's produced by the front-end, with the fourth element
+ * being its length.
  *
  * XXX - C-escape strings!
  * XXX - update LINES_MAX if adding more!
  */
 
-/* Non-breaking, non-collapsing space uses unit separator. */
+/* Special break control characters. */
 static const char ascii_nbrsp[2] = { ASCII_NBRSP, '\0' };
+static const char ascii_break[2] = { ASCII_BREAK, '\0' };
 
 CHAR_TBL_START
 
 /* Spacing. */
-CHAR("c",                      "",             0)
-CHAR("0",                      " ",            8194)
 CHAR(" ",                      ascii_nbrsp,    160)
 CHAR("~",                      ascii_nbrsp,    160)
-CHAR("%",                      "",             0)
-CHAR("&",                      "",             0)
-CHAR("^",                      "",             0)
+CHAR("0",                      " ",            8194)
 CHAR("|",                      "",             0)
+CHAR("^",                      "",             0)
+CHAR("&",                      "",             0)
+CHAR("%",                      "",             0)
+CHAR(":",                      ascii_break,    0)
+/* XXX The following three do not really belong into this file. */
+CHAR("t",                      "",             0)
+CHAR("c",                      "",             0)
 CHAR("}",                      "",             0)
 
 /* Accents. */
-CHAR("a\"",                    "\"",           779)
+CHAR("a\"",                    "\"",           733)
 CHAR("a-",                     "-",            175)
 CHAR("a.",                     ".",            729)
-CHAR("a^",                     "^",            770)
-BOTH("\'",                     "\'",           769)
-BOTH("aa",                     "\'",           769)
-BOTH("ga",                     "`",            768)
-BOTH("`",                      "`",            768)
-CHAR("ab",                     "`",            774)
-CHAR("ac",                     ",",            807)
-CHAR("ad",                     "\"",           776)
+CHAR("a^",                     "^",            94)
+CHAR("\'",                     "\'",           180)
+CHAR("aa",                     "\'",           180)
+CHAR("ga",                     "`",            96)
+CHAR("`",                      "`",            96)
+CHAR("ab",                     "'\b`",         728)
+CHAR("ac",                     ",",            184)
+CHAR("ad",                     "\"",           168)
 CHAR("ah",                     "v",            711)
 CHAR("ao",                     "o",            730)
-CHAR("a~",                     "~",            771)
-CHAR("ho",                     ",",            808)
+CHAR("a~",                     "~",            126)
+CHAR("ho",                     ",",            731)
 CHAR("ha",                     "^",            94)
 CHAR("ti",                     "~",            126)
 
 /* Quotes. */
 CHAR("Bq",                     ",,",           8222)
 CHAR("bq",                     ",",            8218)
-BOTH("lq",                     "``",           8220)
-BOTH("rq",                     "\'\'",         8221)
+CHAR("lq",                     "``",           8220)
+CHAR("rq",                     "\'\'",         8221)
 CHAR("oq",                     "`",            8216)
 CHAR("cq",                     "\'",           8217)
 CHAR("aq",                     "\'",           39)
@@ -84,8 +86,8 @@ CHAR("lB",                    "[",            91)
 CHAR("rB",                     "]",            93)
 CHAR("lC",                     "{",            123)
 CHAR("rC",                     "}",            125)
-CHAR("la",                     "<",            60)
-CHAR("ra",                     ">",            62)
+CHAR("la",                     "<",            10216)
+CHAR("ra",                     ">",            10217)
 CHAR("bv",                     "|",            9130)
 CHAR("braceex",                        "|",            9130)
 CHAR("bracketlefttp",          "|",            9121)
@@ -118,122 +120,122 @@ CHAR("parenrightex",            "|",            9119)
 /* Greek characters. */
 CHAR("*A",                     "A",            913)
 CHAR("*B",                     "B",            914)
-CHAR("*G",                     "|",            915)
-CHAR("*D",                     "/\\",          916)
+CHAR("*G",                     "G",            915)
+CHAR("*D",                     "_\b/_\b\\",    916)
 CHAR("*E",                     "E",            917)
 CHAR("*Z",                     "Z",            918)
 CHAR("*Y",                     "H",            919)
-CHAR("*H",                     "O",            920)
+CHAR("*H",                     "-\bO",         920)
 CHAR("*I",                     "I",            921)
 CHAR("*K",                     "K",            922)
 CHAR("*L",                     "/\\",          923)
 CHAR("*M",                     "M",            924)
 CHAR("*N",                     "N",            925)
-CHAR("*C",                     "H",            926)
+CHAR("*C",                     "_\bH",         926)
 CHAR("*O",                     "O",            927)
 CHAR("*P",                     "TT",           928)
 CHAR("*R",                     "P",            929)
-CHAR("*S",                     ">",            931)
+CHAR("*S",                     "S",            931)
 CHAR("*T",                     "T",            932)
 CHAR("*U",                     "Y",            933)
-CHAR("*F",                     "O_",           934)
+CHAR("*F",                     "I\bO",         934)
 CHAR("*X",                     "X",            935)
-CHAR("*Q",                     "Y",            936)
-CHAR("*W",                     "O",            937)
+CHAR("*Q",                     "I\bY",         936)
+CHAR("*W",                     "_\bO",         937)
 CHAR("*a",                     "a",            945)
 CHAR("*b",                     "B",            946)
 CHAR("*g",                     "y",            947)
 CHAR("*d",                     "d",            948)
 CHAR("*e",                     "e",            949)
-CHAR("*z",                     "C",            950)
+CHAR("*z",                     ",\bC",         950)
 CHAR("*y",                     "n",            951)
-CHAR("*h",                     "0",            952)
+CHAR("*h",                     "-\b0",         952)
 CHAR("*i",                     "i",            953)
 CHAR("*k",                     "k",            954)
-CHAR("*l",                     "\\",           955)
-CHAR("*m",                     "u",            956)
+CHAR("*l",                     ">\b\\",        955)
+CHAR("*m",                     ",\bu",         956)
 CHAR("*n",                     "v",            957)
-CHAR("*c",                     "E",            958)
+CHAR("*c",                     ",\bE",         958)
 CHAR("*o",                     "o",            959)
-CHAR("*p",                     "n",            960)
+CHAR("*p",                     "-\bn",         960)
 CHAR("*r",                     "p",            961)
-CHAR("*s",                     "o",            963)
-CHAR("*t",                     "t",            964)
+CHAR("*s",                     "-\bo",         963)
+CHAR("*t",                     "~\bt",         964)
 CHAR("*u",                     "u",            965)
-CHAR("*f",                     "o",            981)
+CHAR("*f",                     "|\bo",         981)
 CHAR("*x",                     "x",            967)
-CHAR("*q",                     "u",            968)
+CHAR("*q",                     "|\bu",         968)
 CHAR("*w",                     "w",            969)
-CHAR("+h",                     "0",            977)
-CHAR("+f",                     "o",            966)
-CHAR("+p",                     "w",            982)
+CHAR("+h",                     "-\b0",         977)
+CHAR("+f",                     "|\bo",         966)
+CHAR("+p",                     "-\bw",         982)
 CHAR("+e",                     "e",            1013)
 CHAR("ts",                     "s",            962)
 
 /* Accented letters. */
-CHAR(",C",                     "C",            199)
-CHAR(",c",                     "c",            231)
-CHAR("/L",                     "L",            321)
-CHAR("/O",                     "O",            216)
-CHAR("/l",                     "l",            322)
-CHAR("/o",                     "o",            248)
-CHAR("oA",                     "A",            197)
-CHAR("oa",                     "a",            229)
-CHAR(":A",                     "A",            196)
-CHAR(":E",                     "E",            203)
-CHAR(":I",                     "I",            207)
-CHAR(":O",                     "O",            214)
-CHAR(":U",                     "U",            220)
-CHAR(":a",                     "a",            228)
-CHAR(":e",                     "e",            235)
-CHAR(":i",                     "i",            239)
-CHAR(":o",                     "o",            245)
-CHAR(":u",                     "u",            252)
-CHAR(":y",                     "y",            255)
-CHAR("\'A",                    "A",            193)
-CHAR("\'E",                    "E",            201)
-CHAR("\'I",                    "I",            205)
-CHAR("\'O",                    "O",            211)
-CHAR("\'U",                    "U",            218)
-CHAR("\'a",                    "a",            225)
-CHAR("\'e",                    "e",            233)
-CHAR("\'i",                    "i",            237)
-CHAR("\'o",                    "o",            243)
-CHAR("\'u",                    "u",            250)
-CHAR("^A",                     "A",            194)
-CHAR("^E",                     "E",            202)
-CHAR("^I",                     "I",            206)
-CHAR("^O",                     "O",            212)
-CHAR("^U",                     "U",            219)
-CHAR("^a",                     "a",            226)
-CHAR("^e",                     "e",            234)
-CHAR("^i",                     "i",            238)
-CHAR("^o",                     "o",            244)
-CHAR("^u",                     "u",            251)
-CHAR("`A",                     "A",            192)
-CHAR("`E",                     "E",            200)
-CHAR("`I",                     "I",            204)
-CHAR("`O",                     "O",            210)
-CHAR("`U",                     "U",            217)
-CHAR("`a",                     "a",            224)
-CHAR("`e",                     "e",            232)
-CHAR("`i",                     "i",            236)
-CHAR("`o",                     "o",            242)
-CHAR("`u",                     "u",            249)
-CHAR("~A",                     "A",            195)
-CHAR("~N",                     "N",            209)
-CHAR("~O",                     "O",            213)
-CHAR("~a",                     "a",            227)
-CHAR("~n",                     "n",            241)
-CHAR("~o",                     "o",            245)
+CHAR(",C",                     ",\bC",         199)
+CHAR(",c",                     ",\bc",         231)
+CHAR("/L",                     "/\bL",         321)
+CHAR("/O",                     "/\bO",         216)
+CHAR("/l",                     "/\bl",         322)
+CHAR("/o",                     "/\bo",         248)
+CHAR("oA",                     "o\bA",         197)
+CHAR("oa",                     "o\ba",         229)
+CHAR(":A",                     "\"\bA",        196)
+CHAR(":E",                     "\"\bE",        203)
+CHAR(":I",                     "\"\bI",        207)
+CHAR(":O",                     "\"\bO",        214)
+CHAR(":U",                     "\"\bU",        220)
+CHAR(":a",                     "\"\ba",        228)
+CHAR(":e",                     "\"\be",        235)
+CHAR(":i",                     "\"\bi",        239)
+CHAR(":o",                     "\"\bo",        246)
+CHAR(":u",                     "\"\bu",        252)
+CHAR(":y",                     "\"\by",        255)
+CHAR("'A",                     "'\bA",         193)
+CHAR("'E",                     "'\bE",         201)
+CHAR("'I",                     "'\bI",         205)
+CHAR("'O",                     "'\bO",         211)
+CHAR("'U",                     "'\bU",         218)
+CHAR("'a",                     "'\ba",         225)
+CHAR("'e",                     "'\be",         233)
+CHAR("'i",                     "'\bi",         237)
+CHAR("'o",                     "'\bo",         243)
+CHAR("'u",                     "'\bu",         250)
+CHAR("^A",                     "^\bA",         194)
+CHAR("^E",                     "^\bE",         202)
+CHAR("^I",                     "^\bI",         206)
+CHAR("^O",                     "^\bO",         212)
+CHAR("^U",                     "^\bU",         219)
+CHAR("^a",                     "^\ba",         226)
+CHAR("^e",                     "^\be",         234)
+CHAR("^i",                     "^\bi",         238)
+CHAR("^o",                     "^\bo",         244)
+CHAR("^u",                     "^\bu",         251)
+CHAR("`A",                     "`\bA",         192)
+CHAR("`E",                     "`\bE",         200)
+CHAR("`I",                     "`\bI",         204)
+CHAR("`O",                     "`\bO",         210)
+CHAR("`U",                     "`\bU",         217)
+CHAR("`a",                     "`\ba",         224)
+CHAR("`e",                     "`\be",         232)
+CHAR("`i",                     "`\bi",         236)
+CHAR("`o",                     "`\bo",         242)
+CHAR("`u",                     "`\bu",         249)
+CHAR("~A",                     "~\bA",         195)
+CHAR("~N",                     "~\bN",         209)
+CHAR("~O",                     "~\bO",         213)
+CHAR("~a",                     "~\ba",         227)
+CHAR("~n",                     "~\bn",         241)
+CHAR("~o",                     "~\bo",         245)
 
 /* Arrows and lines. */
 CHAR("<-",                     "<-",           8592)
 CHAR("->",                     "->",           8594)
 CHAR("<>",                     "<>",           8596)
 CHAR("da",                     "v",            8595)
-BOTH("ua",                     "^",            8593)
-BOTH("va",                     "^v",           8597)
+CHAR("ua",                     "^",            8593)
+CHAR("va",                     "^v",           8597)
 CHAR("lA",                     "<=",           8656)
 CHAR("rA",                     "=>",           8658)
 CHAR("hA",                     "<=>",          8660)
@@ -270,8 +272,8 @@ CHAR("di",                  "-:-",          247)
 CHAR("tdi",                    "-:-",          247)
 CHAR("f/",                     "/",            8260)
 CHAR("**",                     "*",            8727)
-BOTH("<=",                     "<=",           8804)
-BOTH(">=",                     ">=",           8805)
+CHAR("<=",                     "<=",           8804)
+CHAR(">=",                     ">=",           8805)
 CHAR("<<",                     "<<",           8810)
 CHAR(">>",                     ">>",           8811)
 CHAR("eq",                     "=",            61)
@@ -315,6 +317,9 @@ CHAR("Im",                  "I",            8465)
 CHAR("Re",                     "R",            8476)
 CHAR("pd",                     "a",            8706)
 CHAR("-h",                     "/h",           8463)
+CHAR("12",                     "1/2",          189)
+CHAR("14",                     "1/4",          188)
+CHAR("34",                     "3/4",          190)
 
 /* Ligatures. */
 CHAR("ff",                     "ff",           64256)
@@ -322,8 +327,8 @@ CHAR("fi",                  "fi",           64257)
 CHAR("fl",                     "fl",           64258)
 CHAR("Fi",                     "ffi",          64259)
 CHAR("Fl",                     "ffl",          64260)
-BOTH("AE",                     "AE",           198)
-BOTH("ae",                     "ae",           230)
+CHAR("AE",                     "AE",           198)
+CHAR("ae",                     "ae",           230)
 CHAR("OE",                     "OE",           338)
 CHAR("oe",                     "oe",           339)
 CHAR("ss",                     "ss",           223)
@@ -331,71 +336,22 @@ CHAR("IJ",                        "IJ",           306)
 CHAR("ij",                     "ij",           307)
 
 /* Special letters. */
-CHAR("-D",                     "D",            208)
-CHAR("Sd",                     "o",            240)
-CHAR("TP",                     "b",            222)
-CHAR("Tp",                     "b",            254)
+CHAR("-D",                     "-\bD",         208)
+CHAR("Sd",                     "d",            240)
+CHAR("TP",                     "Th",           222)
+CHAR("Tp",                     "th",           254)
 CHAR(".i",                     "i",            305)
 CHAR(".j",                     "j",            567)
 
 /* Currency. */
 CHAR("Do",                     "$",            36)
-CHAR("ct",                     "c",            162)
+CHAR("ct",                     "/\bc",         162)
 CHAR("Eu",                     "EUR",          8364)
 CHAR("eu",                     "EUR",          8364)
-CHAR("Ye",                     "Y",            165)
-CHAR("Po",                     "L",            163)
-CHAR("Cs",                     "x",            164)
-CHAR("Fn",                     "f",            402)
-
-/* pod2man holdovers. */
-STRING("--",                   "--",           8212)
-STRING("PI",                   "pi",           960)
-STRING("L\"",                  "``",           8220)
-STRING("R\"",                  "\'\'",         8221)
-STRING("C+",                   "C++",          0)
-STRING("C`",                   "`",            8216)
-STRING("C\'",                  "\'",           8217)
-STRING("Aq",                   "\'",           39)
-STRING("^",                    "^",            94)
-STRING(",",                    ",",            44)
-STRING("~",                    "~",            126)
-STRING("/",                    "/",            47)
-STRING(":",                    "\"",           776)
-STRING("8",                    "B",            946)
-STRING("o",                    "o",            176)
-STRING("D-",                   "D",            208)
-STRING("d-",                   "o",            240)
-STRING("Th",                   "b",            222)
-STRING("th",                   "b",            254)
-
-/* Old style. */
-STRING("Am",                   "&",            38)
-STRING("Ba",                   "|",            124)
-STRING("Ge",                   ">=",           8805)
-STRING("Gt",                   ">",            62)
-STRING("If",                   "infinity",     0)
-STRING("Le",                   "<=",           8804)
-STRING("Lq",                   "``",           8220)
-STRING("Lt",                   "<",            60)
-STRING("Na",                   "NaN",          0)
-STRING("Ne",                   "!=",           8800)
-STRING("Pi",                   "pi",           960)
-STRING("Pm",                   "+-",           177)
-STRING("R",                    "(R)",          174)
-STRING("Rq",                   "\'\'",         8221)
-STRING("Tm",                   "tm",           8482)
-STRING("left-bracket",         "[",            91)
-STRING("left-parenthesis",     "(",            40)
-STRING("left-singlequote",     "`",            8216)
-STRING("lp",                   "(",            40)
-STRING("q",                    "\"",           34)
-STRING("quote-left",           "`",            8216)
-STRING("quote-right",          "\'",           8217)
-STRING("right-bracket",                "]",            93)
-STRING("right-parenthesis",    ")",            41)
-STRING("right-singlequote",    "\'",           8217)
-STRING("rp",                   ")",            41)
+CHAR("Ye",                     "=\bY",         165)
+CHAR("Po",                     "GBP",          163)
+CHAR("Cs",                     "o\bx",         164)
+CHAR("Fn",                     ",\bf",         402)
 
 /* Lines. */
 CHAR("ba",                     "|",            124)
@@ -413,8 +369,8 @@ CHAR("dd",                  "=",            8225)
 CHAR("dg",                     "-",            8224)
 CHAR("lz",                     "<>",           9674)
 CHAR("sq",                     "[]",           9633)
-CHAR("ps",                     "9|",           182)
-CHAR("sc",                     "S",            167)
+CHAR("ps",                     "<par>",        182)
+CHAR("sc",                     "<sec>",        167)
 CHAR("lh",                     "<=",           9756)
 CHAR("rh",                     "=>",           9758)
 CHAR("at",                     "@",            64)
@@ -429,18 +385,18 @@ CHAR("tm",                        "tm",           8482)
 
 /* Punctuation. */
 CHAR(".",                      ".",            46)
-CHAR("r!",                     "i",            161)
-CHAR("r?",                     "c",            191)
+CHAR("r!",                     "!",            161)
+CHAR("r?",                     "?",            191)
 CHAR("em",                     "--",           8212)
 CHAR("en",                     "-",            8211)
 CHAR("hy",                     "-",            8208)
 CHAR("e",                      "\\",           92)
 
 /* Units. */
-CHAR("de",                     "o",            176)
+CHAR("de",                     "<deg>",        176)
 CHAR("%0",                     "%o",           8240)
 CHAR("fm",                     "\'",           8242)
 CHAR("sd",                     "\"",           8243)
-CHAR("mc",                     "mu",           181)
+CHAR("mc",                     ",\bu",         181)
 
 CHAR_TBL_END