-
Notifications
You must be signed in to change notification settings - Fork 10
/
t-module-catcodes.mkiv
89 lines (76 loc) · 3.34 KB
/
t-module-catcodes.mkiv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
%D \module
%D [ file=t-module-catcodes,
%D version=2018.04.16,
%D title=\CONTEXT\ User Module,
%D subtitle=Module Catcodes,
%D author=Aditya Mahajan,
%D date=\currentdate,
%D copyright=Aditya Mahajan,
%D email=adityam <at> ieee <dot> org,
%D license=Simplified BSD License]
%D
%D MkII and MkIV use different names and values for commonly used catcode
%D tables. So, I define a private copy of the catcode tables that are needed
%D by the filter and vim modules.
\writestatus{loading}{Module Catcodes (ver: 2018.04.16)}
\startmodule [module-catcodes]
\newcatcodetable \modulecatcodes
\startcatcodetable \modulecatcodes % same as \prtcatcodes
\catcode\tabasciicode \spacecatcode
\catcode\endoflineasciicode \endoflinecatcode
\catcode\formfeedasciicode \endoflinecatcode
\catcode\spaceasciicode \spacecatcode
\catcode\endoffileasciicode \ignorecatcode
\catcode\circumflexasciicode \superscriptcatcode
%catcode\underscoreasciicode \subscriptcatcode
\catcode\underscoreasciicode \lettercatcode
\catcode\ampersandasciicode \alignmentcatcode
\catcode\backslashasciicode \escapecatcode
\catcode\leftbraceasciicode \begingroupcatcode
\catcode\rightbraceasciicode \endgroupcatcode
\catcode\dollarasciicode \mathshiftcatcode
\catcode\hashasciicode \parametercatcode
\catcode\commentasciicode \commentcatcode
\catcode\atsignasciicode \lettercatcode
\catcode\exclamationmarkasciicode \lettercatcode
\catcode\questionmarkasciicode \lettercatcode
\catcode\tildeasciicode \activecatcode
\catcode\barasciicode \activecatcode
\stopcatcodetable
\def\unprotectmodulecatcodes
{\pushcatcodetable
\setcatcodetable\modulecatcodes}
\def\protectmodulecatcodes
{\popcatcodetable}
\unprotectmodulecatcodes
%D The following catcode tables are used for reading
%D and writing to files
\newcatcodetable \externalfilter@read_catcodes
\newcatcodetable \externalfilter@minimal_catcodes
\newcatcodetable \externalfilter@verb_catcodes
\startcatcodetable \externalfilter@read_catcodes % same as typcatcodesa
\catcode\tabasciicode = \othercatcode
\catcode\endoflineasciicode = \othercatcode
\catcode\formfeedasciicode = \othercatcode
\catcode\spaceasciicode = \othercatcode
\catcode\endoffileasciicode = \othercatcode
\catcode\leftbraceasciicode = \begingroupcatcode
\catcode\rightbraceasciicode = \endgroupcatcode
\stopcatcodetable
\startcatcodetable \externalfilter@minimal_catcodes % for reading t-vim output
\catcode\backslashasciicode = \escapecatcode
\catcode\leftbraceasciicode = \begingroupcatcode
\catcode\rightbraceasciicode = \endgroupcatcode
\catcode\endoflineasciicode = \activecatcode
\catcode\formfeedasciicode = \othercatcode
\catcode\spaceasciicode = \activecatcode
\stopcatcodetable
\startcatcodetable \externalfilter@verb_catcodes % same as vrbcatcodes
\catcode\tabasciicode = \othercatcode
\catcode\endoflineasciicode = \othercatcode
\catcode\formfeedasciicode = \othercatcode
\catcode\spaceasciicode = \othercatcode
\catcode\endoffileasciicode = \othercatcode
\stopcatcodetable
\protectmodulecatcodes
\stopmodule