Given how problematic leading tabs in markdown files can be,
we have expanded all leading tabs in markdown files by:
```sh
find * -type f -name '*.md' -print |
while read -r file; do
rm -f "$file.tmp" ;
expand < "$file" > "$file.tmp" ;
mv -f -v "$file.tmp" "$file" ;
done
```
Given the previous changes to `bin/pandoc-wrapper.sh` and other recent
commits and recent pull requests, the were were **NO** changes to
any HTML files. This is a **good thing** as the expression goes.
No there are no leading tabs in any markdown files.
A check to catch any re-introduction of leading tabs
into any markdown file is on the way.
BTW: We do not have anything against leading tabs in files,
even though we have had to deal with their impact on forming
HTML from markdown files (as well as the calc source code).
It is just that this is one of those cases where tabs conflict
(sometimes caused by people wanting to change the classic
8-space tab model) with a desired outcome.
Perform `make www` to perform the above and test under macOS.
2.7 KiB
Spoiler
The program implements a so called Krivine machine, enhanced with a basic input/output system and a reference counting garbage collector. The Krivine machine is a stepwise transformer of a global state consisting of the current term, the current environment (a list of closures), and a stack of continuations (see the 3rd reference for details).
The term space holds lambda calculus terms in the following format. 0 denotes some form of I/O; the only four occurrences are at:
C=13: recognizes end of a byte
C=20: recognize output of 0 bit
C=21: recognize output of 1 bit
C=end: input list, expanded lazily
1 denotes a variable, with the next entry its de Bruijn
index.
2 denotes application with the next entry the size of the term being applied.
3 denotes lambda abstraction.
A closure consists of the following items:
- pointer to the next closure (as part of an environment), or next record on free list.
- reference count.
- pointer to environment.
- lambda term (index in term space).
Here's what each variable does:
L Lambda term space
m mode: 0 for bits and 7 for bytes
b bits remaining unread in I, -1 on EOF
D Desirable temporary
c continuation context
a active environment pointer
C Current term index
U Ultimate term pointer
u utility entry
B Born to be free-list of closures
I Input character
O Output character
e entry of current term
Here's what each of the 6 auxiliary functions do:
s variable lookup in active environment with de Bruijn index u
S gets one bit of input, setting b to -1 on EOF or to remaining number of bits in current byte
k copy fragment from string literal holding lambda terms xor 46 into current end of term space
x expand input, adding 11 (resp. 99) entries to term space for bit (resp. byte) mode
p parses BLC-encoded lambda term using S(), stores results in term space and returns length
d decrease reference counter, add record to free list on reaching zero
Jump to: top