Skip to content

Commit e35c4ee

Browse files
committed
Documentation
1 parent 80558ec commit e35c4ee

1 file changed

Lines changed: 3 additions & 33 deletions

File tree

readme.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ License MIT
8484
8585
## Combinators
8686
87-
ParseBox provides a set of combinators that map to notation expressable in BNF (Backus-Naur Form). These combinators are named Const, Tuple, Union, Array and Optional respectively to describe the produced type given by each combinator. These combinators service as building blocks for constructing parsers.
87+
ParseBox provides a set of combinators that map to notation expressible in (E)BNF (Backus-Naur Form). These combinators are named Const, Tuple, Union, Array, and Optional, respectively, to describe the types produced by each combinator. These combinators serve as building blocks for constructing parsers.
8888
8989
### Const
9090
@@ -96,12 +96,6 @@ The Const combinator parses for the next occurrence of the specified string. Whi
9696
<T> ::= "X"
9797
```
9898
99-
**Type**
100-
101-
```typescript
102-
type T = 'X'
103-
```
104-
10599
**TypeScript**
106100
107101
```typescript
@@ -123,12 +117,6 @@ The Tuple parser matches a sequence of interior parsers. An empty tuple can be u
123117
<T> ::= "X" "Y" "Z"
124118
```
125119

126-
**Type**
127-
128-
```typescript
129-
type T = ['X', 'Y', 'Z']
130-
```
131-
132120
**TypeScript**
133121

134122
```typescript
@@ -155,12 +143,6 @@ The Union combinator parses using one of the interior parsers, attempting each i
155143
<T> ::= "X" | "Y" | "Z"
156144
```
157145

158-
**Type**
159-
160-
```typescript
161-
type T = 'X' | 'Y' | 'Z'
162-
```
163-
164146
**TypeScript**
165147

166148
```typescript
@@ -182,20 +164,14 @@ const R3 = Runtime.Parse(P, 'Z E') // const R3 = ['Z', ' E']
182164

183165
### Array
184166

185-
The Array combinator will parse for zero or more the interior parser. This combinator will always return a result with an empty array for no matches.
167+
The Array combinator will parse for zero or more the interior parser. This combinator will always return a result with an empty array given for no matches.
186168

187169
**EBNF**
188170

189171
```
190172
<T> ::= { "X" }
191173
```
192174

193-
**Type**
194-
195-
```typescript
196-
type T = 'X'[]
197-
```
198-
199175
**TypeScript**
200176

201177
```typescript
@@ -213,20 +189,14 @@ const R3 = Runtime.Parse(T, 'Y Z') // const R3 = [[], 'Y Z']
213189

214190
### Optional
215191

216-
The Optional combinator will parse for zero or one of the interior parser. This combinator always succeeds, returning either a tuple with one element, or zero for no match.
192+
The Optional combinator will parse for zero or one of the interior parser. This combinator always succeeds, returning either a tuple with one element, or zero elements for no match.
217193

218194
**EBNF**
219195

220196
```
221197
<T> ::= [ "X" ]
222198
```
223199

224-
**Type**
225-
226-
```typescript
227-
type T = ['X'] | []
228-
```
229-
230200
**TypeScript**
231201

232202
```typescript

0 commit comments

Comments
 (0)