-
Notifications
You must be signed in to change notification settings - Fork 5
/
0001-Support-extended-syntax-for-numeric-literals.patch
94 lines (87 loc) · 3.93 KB
/
0001-Support-extended-syntax-for-numeric-literals.patch
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
90
91
92
93
From ba514ca2a52ab65e46d3477724672564cb492646 Mon Sep 17 00:00:00 2001
From: Andreas Scherer <andreas_github@freenet.de>
Date: Mon, 29 Mar 2021 13:14:34 +0200
Subject: [PATCH 1/5] Support extended syntax for numeric literals.
---
ctwimac.tex | 15 ++++++++++-----
proofmac.tex | 15 ++++++++++-----
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/ctwimac.tex b/ctwimac.tex
index eddd6af..1fbb0ac 100644
--- a/ctwimac.tex
+++ b/ctwimac.tex
@@ -1,9 +1,9 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 3.6 --- May 2000
+% Version 4.3 --- April 2021
% modified for pages produced by CTWILL
% further modified for page size of the MMIXware book
\ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CTWILL3.6+LNCS}
+\xdef\fmtversion{\fmtversion+CTWILL4.3+LNCS}
\let\:=\. % preserve a way to get the dot accent
% (all other accents will still work as usual)
@@ -278,7 +278,8 @@
\hbox{$\def\?{\kern.2em}%
\def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
- \let\~=\oct \let\^=\hex {#1}$}}
+ \def\%{\cdot 16^{\aftergroup}}% power of sixteen (via dirty trick)
+ \let\~=\oct \let\^=\hex \let\\=\bin{#1}$}}%$%
\def\U{\note{This code is used in section}} % xref for use of a section
\def\Us{\note{This code is used in sections}} % xref for uses of a section
\let\V=\lor % logical or
@@ -292,8 +293,12 @@
%\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
%\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style
-\def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\oct{\hbox{$^\circ$\kern-.1em}\Od}% CWEB style
+\def\hex{\hbox{$^{\scriptscriptstyle\#}$}\Hd} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$}\Bd}
+\def\Od#1/{{\it#1}} % octal digit
+\def\Hd#1/{{\tt#1}} % hexadecimal digit
+\def\Bd#1/{{\tt#1}} % binary digit
\def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
\hbox{\strut\kern2pt\.{#1}\kern2pt}}
\hrule}\vrule\kern2pt}} % verbatim string
diff --git a/proofmac.tex b/proofmac.tex
index 29533b8..dbcf312 100644
--- a/proofmac.tex
+++ b/proofmac.tex
@@ -1,8 +1,8 @@
% standard macros for CWEB listings (in addition to plain.tex)
-% Version 3.6 --- May 2000
+% Version 4.3 --- April 2021
% Modified for proofs in CTWILL
\ifx\documentstyle\undefined\else\endinput\fi % LaTeX will use other macros
-\xdef\fmtversion{\fmtversion+CWEB3.6+PROOFS}
+\xdef\fmtversion{\fmtversion+CWEB4.3+PROOFS}
\let\:=\. % preserve a way to get the dot accent
% (all other accents will still work as usual)
@@ -162,7 +162,8 @@
\hbox{$\def\?{\kern.2em}%
\def\$##1{\egroup_{\,\rm##1}\bgroup}% suffix to constant
\def\_{\cdot 10^{\aftergroup}}% power of ten (via dirty trick)
- \let\~=\oct \let\^=\hex {#1}$}}
+ \def\%{\cdot 16^{\aftergroup}}% power of sixteen (via dirty trick)
+ \let\~=\oct \let\^=\hex \let\\=\bin{#1}$}}%$%
\def\U{\note{This code is used in section}} % xref for use of a section
\def\Us{\note{This code is used in sections}} % xref for uses of a section
\let\V=\lor % logical or
@@ -176,8 +177,12 @@
%\def\oct{\hbox{\rm\char'23\kern-.2em\it\aftergroup\?\aftergroup}} % WEB style
%\def\hex{\hbox{\rm\char"7D\tt\aftergroup}} % WEB style
-\def\oct{\hbox{$^\circ$\kern-.1em\it\aftergroup\?\aftergroup}}% CWEB style
-\def\hex{\hbox{$^{\scriptscriptstyle\#}$\tt\aftergroup}} % CWEB style
+\def\oct{\hbox{$^\circ$\kern-.1em}\Od}% CWEB style
+\def\hex{\hbox{$^{\scriptscriptstyle\#}$}\Hd} % CWEB style
+\def\bin{\hbox{$^{\scriptscriptstyle b}$}\Bd}
+\def\Od#1/{{\it#1}} % octal digit
+\def\Hd#1/{{\tt#1}} % hexadecimal digit
+\def\Bd#1/{{\tt#1}} % binary digit
\def\vb#1{\leavevmode\hbox{\kern2pt\vrule\vtop{\vbox{\hrule
\hbox{\strut\kern2pt\.{#1}\kern2pt}}
\hrule}\vrule\kern2pt}} % verbatim string
--
2.41.0