catc-def.mkiv /size: 5995 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=catc-def,
3%D        version=2006.09.18,
4%D          title=\CONTEXT\ Catcode Macros,
5%D       subtitle=Default Tables,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D The following catcode tables are rather \CONTEXT\ independent.
15
16\ifdefined\nilcatcodes \else \newcatcodetable \nilcatcodes  \fi
17\ifdefined\texcatcodes \else \newcatcodetable \texcatcodes  \fi
18\ifdefined\luacatcodes \else \newcatcodetable \luacatcodes  \fi
19\ifdefined\notcatcodes \else \newcatcodetable \notcatcodes  \fi
20\ifdefined\vrbcatcodes \else \newcatcodetable \vrbcatcodes  \fi
21\ifdefined\prtcatcodes \else \newcatcodetable \prtcatcodes  \fi
22
23\startcatcodetable \nilcatcodes
24    \catcode\tabasciicode       \spacecatcode
25    \catcode\endoflineasciicode \endoflinecatcode
26    \catcode\formfeedasciicode  \endoflinecatcode
27    \catcode\spaceasciicode     \spacecatcode
28    \catcode\endoffileasciicode \ignorecatcode
29\stopcatcodetable
30
31\startcatcodetable \texcatcodes
32    \catcode\tabasciicode       \spacecatcode
33    \catcode\endoflineasciicode \endoflinecatcode
34    \catcode\formfeedasciicode  \endoflinecatcode
35    \catcode\spaceasciicode     \spacecatcode
36    \catcode\endoffileasciicode \ignorecatcode
37    \catcode\circumflexasciicode\superscriptcatcode
38    \catcode\underscoreasciicode\subscriptcatcode
39    \catcode\ampersandasciicode \alignmentcatcode
40    \catcode\backslashasciicode \escapecatcode
41    \catcode\leftbraceasciicode \begingroupcatcode
42    \catcode\rightbraceasciicode\endgroupcatcode
43    \catcode\dollarasciicode    \mathshiftcatcode
44    \catcode\hashasciicode      \parametercatcode
45    \catcode\commentasciicode   \commentcatcode
46\stopcatcodetable
47
48\startcatcodetable \luacatcodes
49    \catcode\tabasciicode       \othercatcode
50    \catcode\endoflineasciicode \othercatcode
51    \catcode\formfeedasciicode  \othercatcode
52    \catcode\spaceasciicode     \othercatcode
53    \catcode\endoffileasciicode \ignorecatcode
54    \catcode\circumflexasciicode\othercatcode
55    \catcode\underscoreasciicode\othercatcode
56    \catcode\ampersandasciicode \othercatcode
57    \catcode\backslashasciicode \escapecatcode
58    \catcode\commentasciicode   \othercatcode
59    \catcode\hashasciicode      \othercatcode
60    \catcode\barasciicode       \othercatcode
61    \catcode\leftbraceasciicode \othercatcode
62    \catcode\rightbraceasciicode\othercatcode
63    \catcode\tildeasciicode     \othercatcode
64    \catcode\dollarasciicode    \othercatcode
65\stopcatcodetable
66
67\startcatcodetable \notcatcodes % probably less needed
68    \catcode\tabasciicode         \spacecatcode
69    \catcode\endoflineasciicode   \endoflinecatcode
70    \catcode\formfeedasciicode    \endoflinecatcode
71    \catcode\spaceasciicode       \spacecatcode
72    \catcode\endoffileasciicode   \ignorecatcode
73    \catcode\circumflexasciicode  \othercatcode
74    \catcode\underscoreasciicode  \othercatcode
75    \catcode\ampersandasciicode   \othercatcode
76    \catcode\tildeasciicode       \othercatcode
77    \catcode\hashasciicode        \othercatcode
78    \catcode\dollarasciicode      \othercatcode
79    \catcode\commentasciicode     \othercatcode
80    \catcode\lessthanasciicode    \othercatcode
81    \catcode\morethanasciicode    \othercatcode
82    \catcode\leftbraceasciicode   \othercatcode
83    \catcode\rightbraceasciicode  \othercatcode
84    \catcode\doublequoteasciicode \othercatcode
85    \catcode\singlequoteasciicode \othercatcode
86    \catcode\forwardslashasciicode\othercatcode
87    \catcode\backslashasciicode   \othercatcode
88    \catcode\barasciicode         \othercatcode
89\stopcatcodetable
90
91\startcatcodetable \vrbcatcodes % probably less needed
92    \catcode\tabasciicode      \othercatcode
93    \catcode\endoflineasciicode\othercatcode
94    \catcode\formfeedasciicode \othercatcode
95    \catcode\spaceasciicode    \othercatcode
96    \catcode\endoffileasciicode\othercatcode
97\stopcatcodetable
98
99\startcatcodetable \prtcatcodes
100    \catcode\tabasciicode            \spacecatcode
101    \catcode\endoflineasciicode      \endoflinecatcode
102    \catcode\formfeedasciicode       \endoflinecatcode
103    \catcode\spaceasciicode          \spacecatcode
104    \catcode\endoffileasciicode      \ignorecatcode
105    \catcode\circumflexasciicode     \superscriptcatcode
106    %catcode\underscoreasciicode     \subscriptcatcode
107    \catcode\underscoreasciicode     \lettercatcode
108    \catcode\ampersandasciicode      \alignmentcatcode
109    \catcode\backslashasciicode      \escapecatcode
110    \catcode\leftbraceasciicode      \begingroupcatcode
111    \catcode\rightbraceasciicode     \endgroupcatcode
112    \catcode\dollarasciicode         \mathshiftcatcode
113    \catcode\hashasciicode           \parametercatcode
114    \catcode\commentasciicode        \commentcatcode
115    \catcode\atsignasciicode         \lettercatcode
116    \catcode\exclamationmarkasciicode\lettercatcode
117    \catcode\questionmarkasciicode   \lettercatcode
118    \catcode\tildeasciicode          \activecatcode
119    \catcode\barasciicode            \activecatcode
120\stopcatcodetable
121
122%D Because some characters have a special meaning, we provide
123%D shortcuts to their character representation.
124
125\chardef \^ = \circumflexasciicode
126\chardef \_ = \underscoreasciicode
127\chardef \& = \ampersandasciicode
128\chardef \% = \commentasciicode
129\chardef \# = \hashasciicode
130\chardef \$ = \dollarasciicode
131\chardef \{ = \leftbraceasciicode
132\chardef \} = \rightbraceasciicode
133\chardef \\ = \backslashasciicode
134\chardef \| = \barasciicode
135
136% way too wide in lm, so one can also use:
137%
138% \def\_{\dontleavehmode \kern.06em \vbox{\hrule width.3em}} % this will become a \chardef
139
140%D From now on we can use the protection mechanisms.
141
142\protected\def\unprotect{\pushcatcodetable\setcatcodetable\prtcatcodes}
143\protected\def\protect  {\popcatcodetable}
144
145% \prependtoks \catcodetable\ctxcatcodes \to \everyjob
146
147\endinput
148