improved indentation and whitespace for markdown code blocks
All code blocks in markdown have been intended by at least 4 spaces. We add `--tab-stop=8` to all `pandoc(1)` executions in order to set a better tab stop indentation, especially for tab intended code blocks. Changed `bin/pandoc-wrapper.sh` VERSION from "1.5.3 2024-03-26" to "1.6 2024-03-31". Fixed `1991/brnstnd/sorta.README.md` so that the sorta code is code blocks. Removed unneeded paragraph group in copyright in `inc/footer.default.html`. Fixed excess whitespace after list Author on entry `index.html` page. Changed `bin/output-index-author.sh` VERSION from "1.5.2 2024-03-26" to "1.6 2024-03-31". Performed `make www` to perform the above and test under macOS. TODO: Fix the problem of the initial line of code being extra intended. TODO: Fix excess whitespace around code that is inline.
This commit is contained in:
1 parent
b84c27ce02
commit
a996f8d2b8
734 files changed
+16723
-16963
No files matched your search
+80
-81
@@ -1,7 +1,7 @@
|
||||
## To build:
|
||||
|
||||
```sh
|
||||
make all
|
||||
make all
|
||||
```
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ make all
|
||||
The current status of this entry is:
|
||||
|
||||
```
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
STATUS: INABIAF - please **DO NOT** fix
|
||||
```
|
||||
|
||||
For more detailed information see [1993 vanb bugs](../../bugs.html#1993_vanb).
|
||||
@@ -19,7 +19,7 @@ For more detailed information see [1993 vanb bugs](../../bugs.html#1993_vanb).
|
||||
## To use:
|
||||
|
||||
```sh
|
||||
./vanb 'exp'
|
||||
./vanb 'exp'
|
||||
```
|
||||
|
||||
where `exp` is an octal expression. See below for how it can also have
|
||||
@@ -29,7 +29,7 @@ hexadecimal and decimal numbers.
|
||||
## Try:
|
||||
|
||||
```sh
|
||||
./try.sh
|
||||
./try.sh
|
||||
```
|
||||
|
||||
What happens if you use something other than valid digits?
|
||||
@@ -40,12 +40,12 @@ What happens if you use something other than valid digits?
|
||||
The octal expression may contain:
|
||||
|
||||
```
|
||||
unary operators: +, -
|
||||
binary operators +, -, *, /, %
|
||||
hex numbers: x or X followed by hex digits
|
||||
decimal numbers: d or D followed by decimal digits
|
||||
octal numbers: octal digits
|
||||
grouping: ()
|
||||
unary operators: +, -
|
||||
binary operators +, -, *, /, %
|
||||
hex numbers: x or X followed by hex digits
|
||||
decimal numbers: d or D followed by decimal digits
|
||||
octal numbers: octal digits
|
||||
grouping: ()
|
||||
```
|
||||
|
||||
No spaces are allowed in the expression. To avoid shell expansion,
|
||||
@@ -94,7 +94,7 @@ what grammar non-terminal to parse. `**O7` is the next character.
|
||||
`O3` is an intermediate result. Whenever you see a construct like:
|
||||
|
||||
```
|
||||
!(expression with O2)?
|
||||
!(expression with O2)?
|
||||
```
|
||||
|
||||
it's decrementing and testing `O2` to see what state it's in. Comparisons
|
||||
@@ -104,29 +104,29 @@ Here's the grammar (`'e'` denotes the empty string) :
|
||||
|
||||
|
||||
```
|
||||
<E> ::= <T><E'>
|
||||
<E'> ::= +<T><E'> | -<T><E'> | e
|
||||
<T> ::= <F><T'>
|
||||
<T'> ::= *<F><T'> | /<F><T'> | %<F><T'> | e
|
||||
<F> ::= +<F> | -<F> | (<E><C> | d<D> | D<D> | x<X> | X<X> | <O>
|
||||
<C> ::= )
|
||||
<D> ::= [0-9]<D> | e
|
||||
<X> ::= [0-9]<X> | [A-F]<X> | [a-f]<X> | e
|
||||
<O> ::= [0-7]<O> | e
|
||||
<E> ::= <T><E'>
|
||||
<E'> ::= +<T><E'> | -<T><E'> | e
|
||||
<T> ::= <F><T'>
|
||||
<T'> ::= *<F><T'> | /<F><T'> | %<F><T'> | e
|
||||
<F> ::= +<F> | -<F> | (<E><C> | d<D> | D<D> | x<X> | X<X> | <O>
|
||||
<C> ::= )
|
||||
<D> ::= [0-9]<D> | e
|
||||
<X> ::= [0-9]<X> | [A-F]<X> | [a-f]<X> | e
|
||||
<O> ::= [0-7]<O> | e
|
||||
```
|
||||
|
||||
Here's how the grammar nonterminals map to octal state numbers:
|
||||
|
||||
```
|
||||
<E> is 012
|
||||
<E'> is 011
|
||||
<T> is 010
|
||||
<T'> is 07
|
||||
<F> is 06
|
||||
<C> is 013
|
||||
<D> is 04
|
||||
<X> is 05
|
||||
<O> is 03
|
||||
<E> is 012
|
||||
<E'> is 011
|
||||
<T> is 010
|
||||
<T'> is 07
|
||||
<F> is 06
|
||||
<C> is 013
|
||||
<D> is 04
|
||||
<X> is 05
|
||||
<O> is 03
|
||||
```
|
||||
|
||||
Here's a version of the program before it got formatted into the VIII,
|
||||
@@ -134,41 +134,41 @@ augmented with comments showing where each state begins. `N1` and `N2` are
|
||||
notes:
|
||||
|
||||
```c
|
||||
#define O5 main
|
||||
O5(O2,O7,O3)char**O7;
|
||||
{
|
||||
return
|
||||
/* N1 */ !(O2+=~01+01) ?\
|
||||
00:
|
||||
/* N2 */ !(O2-=02>01) ?\
|
||||
printf("\045\157\012",O5(012,O7+01,00)):
|
||||
/* O */ !(O2-=02>>01) ?\
|
||||
(**O7<=067 && **O7>057 ? O5(03,O7,*(*O7)++-060+010*O3):O3):
|
||||
/* D */ !(O2-=-O3-~O3) ?\
|
||||
(072>**O7 && 060<=**O7 ? O5(04,O7,012*O3-060+*(*O7)++):O3):
|
||||
/* X */ !(O2-=!O3+!!O3) ?\
|
||||
(**O7>057 && **O7<=071 ? O5(05,O7,*(*O7)+++O3*020-060):
|
||||
**O7<=0106 && 0101<=**O7 ? O5(05,O7,020*O3+*(*O7)++-067):
|
||||
0140<**O7 && **O7<0147 ? O5(05,O7,-0127+*(*O7)+++020*O3):O3):
|
||||
/* F */ !(O2-=02-01) ?\
|
||||
(**O7==050 ? 050**++*O7,O5(013,O7,O5(012,O7,00)):
|
||||
**O7<056 && 054<**O7 ? 055**++*O7,-O5(06,O7,00):
|
||||
054>**O7 && 052<**O7 ? 050**(*O7)++,O5(06,O7,00):
|
||||
!(**O7^0170)||!(0130^**O7) ? *++*O7,O5(05,O7,00):
|
||||
**O7==0144||**O7==0104 ? ++*O7,O5(04,O7,00):O5(03,O7,00)):
|
||||
/* T' */ !--O2 ?\
|
||||
(**O7==052 ? O5(07,O7,O3*(*++*O7,O5(06,O7,00))):
|
||||
!(045-**O7) ? O5(07,O7,O3%(03+(*O7)++,O5(06,O7,00))):
|
||||
!(**O7^057) ? O5(07,O7,O3/(03-*++*O7,O5(06,O7,00))):O3):
|
||||
/* T */ !(O2+=01-02) ?\
|
||||
O5(07,O7,O5(06,O7,00)):
|
||||
/* E' */ !(O2+=-02/02) ?\
|
||||
(!(**O7-053)?O5(011,O7,O3+(++*O7,O5(010,O7,00))):
|
||||
!(055^**O7) ? O5(011,O7,O3-(03+*(*O7)++,O5(010,O7,00))):O3):
|
||||
/* E */ !(O2-=0563&0215) ?\
|
||||
O5(011,O7,O5(010,O7,00)):
|
||||
/* C */ (++*O7,O3);
|
||||
}
|
||||
#define O5 main
|
||||
O5(O2,O7,O3)char**O7;
|
||||
{
|
||||
return
|
||||
/* N1 */ !(O2+=~01+01) ?\
|
||||
00:
|
||||
/* N2 */ !(O2-=02>01) ?\
|
||||
printf("\045\157\012",O5(012,O7+01,00)):
|
||||
/* O */ !(O2-=02>>01) ?\
|
||||
(**O7<=067 && **O7>057 ? O5(03,O7,*(*O7)++-060+010*O3):O3):
|
||||
/* D */ !(O2-=-O3-~O3) ?\
|
||||
(072>**O7 && 060<=**O7 ? O5(04,O7,012*O3-060+*(*O7)++):O3):
|
||||
/* X */ !(O2-=!O3+!!O3) ?\
|
||||
(**O7>057 && **O7<=071 ? O5(05,O7,*(*O7)+++O3*020-060):
|
||||
**O7<=0106 && 0101<=**O7 ? O5(05,O7,020*O3+*(*O7)++-067):
|
||||
0140<**O7 && **O7<0147 ? O5(05,O7,-0127+*(*O7)+++020*O3):O3):
|
||||
/* F */ !(O2-=02-01) ?\
|
||||
(**O7==050 ? 050**++*O7,O5(013,O7,O5(012,O7,00)):
|
||||
**O7<056 && 054<**O7 ? 055**++*O7,-O5(06,O7,00):
|
||||
054>**O7 && 052<**O7 ? 050**(*O7)++,O5(06,O7,00):
|
||||
!(**O7^0170)||!(0130^**O7) ? *++*O7,O5(05,O7,00):
|
||||
**O7==0144||**O7==0104 ? ++*O7,O5(04,O7,00):O5(03,O7,00)):
|
||||
/* T' */ !--O2 ?\
|
||||
(**O7==052 ? O5(07,O7,O3*(*++*O7,O5(06,O7,00))):
|
||||
!(045-**O7) ? O5(07,O7,O3%(03+(*O7)++,O5(06,O7,00))):
|
||||
!(**O7^057) ? O5(07,O7,O3/(03-*++*O7,O5(06,O7,00))):O3):
|
||||
/* T */ !(O2+=01-02) ?\
|
||||
O5(07,O7,O5(06,O7,00)):
|
||||
/* E' */ !(O2+=-02/02) ?\
|
||||
(!(**O7-053)?O5(011,O7,O3+(++*O7,O5(010,O7,00))):
|
||||
!(055^**O7) ? O5(011,O7,O3-(03+*(*O7)++,O5(010,O7,00))):O3):
|
||||
/* E */ !(O2-=0563&0215) ?\
|
||||
O5(011,O7,O5(010,O7,00)):
|
||||
/* C */ (++*O7,O3);
|
||||
}
|
||||
```
|
||||
|
||||
Note `N1`: It should never enter this state, unless the user invokes the
|
||||
@@ -181,39 +181,38 @@ printf, and sends the parser to state `012` (which is `<E>`).
|
||||
The `E` and `T` states work like this:
|
||||
|
||||
```c
|
||||
int e(){ return eprime( t() ); }
|
||||
int e(){ return eprime( t() ); }
|
||||
```
|
||||
|
||||
|
||||
The `E'` and `T'` states work like this:
|
||||
|
||||
```c
|
||||
int eprime( int intermediate )
|
||||
{
|
||||
if( ch == '+' )
|
||||
int eprime( int intermediate )
|
||||
{
|
||||
ch = nextchar();
|
||||
return eprime( intermediate + t() );
|
||||
if( ch == '+' )
|
||||
{
|
||||
ch = nextchar();
|
||||
return eprime( intermediate + t() );
|
||||
}
|
||||
else return intermediate;
|
||||
}
|
||||
else return intermediate;
|
||||
}
|
||||
```
|
||||
|
||||
The `D`, `X` and `O` states work like this (they assume that they're initially
|
||||
called with `0`):
|
||||
|
||||
```c
|
||||
int octal( int intermediate )
|
||||
{
|
||||
if( ch>='0' && ch<='7' )
|
||||
int octal( int intermediate )
|
||||
{
|
||||
intermediate = intermediate * 8 + ch - '0';
|
||||
ch = nextchar();
|
||||
return octal( intermediate );
|
||||
if( ch>='0' && ch<='7' )
|
||||
{
|
||||
intermediate = intermediate * 8 + ch - '0';
|
||||
ch = nextchar();
|
||||
return octal( intermediate );
|
||||
}
|
||||
else return intermediate;
|
||||
}
|
||||
else return intermediate;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
`F` and `C` work similarly.
|
||||
|
||||
Reference in new issue
Block a user