Skip to content

Commit 0d4e2ec

Browse files
committed
docs
1 parent fd88386 commit 0d4e2ec

1 file changed

Lines changed: 0 additions & 54 deletions

File tree

readme.md

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ License: MIT
7171
- [Array](#Array)
7272
- [Optional](#Optional)
7373
- [Epsilon](#Epsilon)
74-
- [Until](#Until)
75-
- [Until](#Until)
76-
- [NonEmpty](#UntilNonEmpty)
7774
- [Terminals](#Terminals)
7875
- [Ident](#Ident)
7976
- [BigInt](#BigInt)
@@ -238,57 +235,6 @@ const R1 = Runtime.Parse(T, 'X Y Z') // const R1 = [['X', 'Y'], '
238235
const R2 = Runtime.Parse(T, 'Y Z') // const R2 = [[], 'Y Z']
239236
```
240237

241-
## Until
242-
243-
ParseBox range combinators match character sequences up to one or more terminating sentinel strings. These combinators are used to match arbituary Unicode (UTF-16) sequences.
244-
245-
246-
### Until
247-
248-
The Until combinator parses characters up to (but not including) one of the specified sentinel string values. It captures all characters encountered before the sentinel. If a sentinel value is not found in the input, parsing fails. Until succeeds even if it matches a zero-length string. This occurs if a sentinel is found immediately at the current parsing position.
249-
250-
**BNF**
251-
252-
```bnf
253-
<T> ::= ? any character sequence (0 or more) until 'Z' ?
254-
```
255-
256-
**TypeScript**
257-
258-
```typescript
259-
const T = Runtime.Until(['Z']) // const T = {
260-
// type: 'Until',
261-
// values: ['Z']
262-
// }
263-
264-
const R = Runtime.Parse(T, 'X Y Z') // const R = ['X Y ', 'Z']
265-
```
266-
267-
### UntilNonEmpty
268-
269-
The UntilNonEmpty combinator works the same as Until, but it fails if the parsed content yields a zero-length string.
270-
271-
**BNF**
272-
273-
```bnf
274-
<T> ::= ? any character sequence (1 or more) until 'Z'. fails on zero length ?
275-
```
276-
277-
**TypeScript**
278-
279-
```typescript
280-
const T = Runtime.UntilNonEmpty(['Z']) // const T = {
281-
// type: 'UntilNonEmpty',
282-
// values: ['Z']
283-
// }
284-
285-
const R1 = Runtime.Parse(T, 'X Y Z') // const R1 = ['X Y ', 'Z']
286-
287-
const R2 = Runtime.Parse(T, ' Z') // const R2 = [' ', 'Z']
288-
289-
const R3 = Runtime.Parse(T, 'Z') // const R3 = []
290-
```
291-
292238
## Terminal Combinators
293239

294240
ParseBox provides combinators for parsing common lexical tokens, such as numbers, identifiers, and strings, enabling static, optimized parsing of typical JavaScript constructs.

0 commit comments

Comments
 (0)