Skip to content

Commit 4983372

Browse files
committed
update docs structure
1 parent f72f922 commit 4983372

7 files changed

Lines changed: 219 additions & 190 deletions

File tree

docs/Cursor.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ <h1>
7171
Cursor
7272
</h1>
7373
<div class="module-description">
74-
74+
<p>is a cursor over the parser input: <code>pos</code> (byte offset),
75+
<code>line</code>, and <code>col</code>. Newline-aware: <code>\n</code> advances <code>line</code> and resets
76+
<code>col</code> to 1. Users mostly see <code>Cursor</code> values via <code>ParseErr</code> for error
77+
reporting.</p>
78+
7579
</div>
7680
<div class="binder">
7781
<a class="anchor" href="#=">
@@ -109,7 +113,7 @@ <h3 id="advance">
109113
</pre>
110114
<p class="doc">
111115
<p>advances the cursor past one byte. If the byte is a
112-
newline, the line counter increments and col resets to 1.</p>
116+
newline, <code>line</code> increments and <code>col</code> resets to 1.</p>
113117

114118
</p>
115119
</div>
@@ -469,7 +473,7 @@ <h3 id="zero">
469473
(zero)
470474
</pre>
471475
<p class="doc">
472-
<p>the initial cursor: pos=0, line=1, col=1.</p>
476+
<p>is the initial cursor: <code>pos=0</code>, <code>line=1</code>, <code>col=1</code>.</p>
473477

474478
</p>
475479
</div>

docs/ParseErr.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ <h1>
7171
ParseErr
7272
</h1>
7373
<div class="module-description">
74-
74+
<p>is a parser failure carrying byte/line/column position,
75+
an optional <code>unexpected</code> token, and an <code>expected</code> set of labels
76+
gathered from parsers that failed at that position. Render with
77+
<code>Parser.format-error</code>.</p>
78+
7579
</div>
7680
<div class="binder">
7781
<a class="anchor" href="#col">
@@ -149,7 +153,7 @@ <h3 id="empty-at">
149153
(empty-at cur)
150154
</pre>
151155
<p class="doc">
152-
<p>creates a ParseErr at cur with no labels.</p>
156+
<p>creates a <code>ParseErr</code> at <code>cur</code> with no labels.</p>
153157

154158
</p>
155159
</div>
@@ -189,7 +193,7 @@ <h3 id="expected-at">
189193
(expected-at cur lbl)
190194
</pre>
191195
<p class="doc">
192-
<p>creates a ParseErr at cur with one expected label.</p>
196+
<p>creates a <code>ParseErr</code> at <code>cur</code> with one expected label.</p>
193197

194198
</p>
195199
</div>

docs/Parser.Lexer.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ <h1>
7171
Parser.Lexer
7272
</h1>
7373
<div class="module-description">
74-
74+
<p>is a submodule of common-token parsers: whitespace
75+
handling, integers, identifiers, and literal symbols.</p>
76+
7577
</div>
7678
<div class="binder">
7779
<a class="anchor" href="#identifier">
@@ -89,9 +91,9 @@ <h3 id="identifier">
8991
(identifier)
9092
</pre>
9193
<p class="doc">
92-
<p>parses a C-style identifier: a letter or underscore,
93-
followed by zero or more letters, digits, or underscores. Returns the
94-
matched text as a String.</p>
94+
<p>parses a C-style identifier: a letter or
95+
underscore, followed by zero or more letters, digits, or underscores.
96+
Returns the matched text as a <code>String</code>.</p>
9597

9698
</p>
9799
</div>
@@ -111,8 +113,8 @@ <h3 id="integer">
111113
(integer)
112114
</pre>
113115
<p class="doc">
114-
<p>parses an optional <code>-</code> sign followed by decimal digits as
115-
an Int. Fused into a single closure.</p>
116+
<p>parses an optional <code>-</code> sign followed by decimal
117+
digits as an <code>Int</code>. Fused into a single closure.</p>
116118

117119
</p>
118120
</div>
@@ -132,7 +134,7 @@ <h3 id="lexeme">
132134
(lexeme p)
133135
</pre>
134136
<p class="doc">
135-
<p>runs p, then skips trailing whitespace. Returns p's value.</p>
137+
<p>runs <code>p</code>, then skips trailing whitespace. Returns <code>p</code>'s value.</p>
136138

137139
</p>
138140
</div>
@@ -152,7 +154,7 @@ <h3 id="symbol">
152154
(symbol s)
153155
</pre>
154156
<p class="doc">
155-
<p>matches the literal string s, then skips trailing whitespace.</p>
157+
<p>matches the literal string <code>s</code>, then skips trailing whitespace.</p>
156158

157159
</p>
158160
</div>
@@ -172,8 +174,9 @@ <h3 id="unsigned-int">
172174
(unsigned-int)
173175
</pre>
174176
<p class="doc">
175-
<p>parses one or more decimal digits as an Int. Fused
176-
into a single closure for performance — does not go through bind/map.</p>
177+
<p>parses one or more decimal digits as an
178+
<code>Int</code>. Fused into a single closure for performance — does not go
179+
through <code>bind</code>/<code>map</code>.</p>
177180

178181
</p>
179182
</div>

docs/Parser.UTF8.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ <h1>
7171
Parser.UTF8
7272
</h1>
7373
<div class="module-description">
74-
74+
<p>is a submodule of codepoint-level parsers layered on the
75+
byte-level core. Each codepoint advances the cursor by one column,
76+
regardless of byte width.</p>
77+
7578
</div>
7679
<div class="binder">
7780
<a class="anchor" href="#any-char">
@@ -89,8 +92,8 @@ <h3 id="any-char">
8992
(any-char)
9093
</pre>
9194
<p class="doc">
92-
<p>consumes one UTF-8 codepoint, returning it as Char.
93-
Fails empty at end of input or on malformed UTF-8.</p>
95+
<p>consumes one UTF-8 codepoint, returning it as a
96+
<code>Char</code>. Fails empty at end of input or on malformed UTF-8.</p>
9497

9598
</p>
9699
</div>

0 commit comments

Comments
 (0)