-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
647 additions
and
647 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) | ||
|
||
## API Reference | ||
|
||
## Packages | ||
|
||
| Package | Description | | ||
| --- | --- | | ||
| [prsc](./prsc.md) | | | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) | ||
|
||
## API Reference | ||
|
||
## Packages | ||
|
||
| Package | Description | | ||
| --- | --- | | ||
| [prsc](./prsc.md) | | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [complete](./prsc.complete.md) | ||
|
||
## complete() function | ||
|
||
Creates a parser that applies the given parser and only succeeds (returning the inner parser's result) if parsing concludes at the end of the input string. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function complete<T>(parser: Parser<T>): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| parser | <code>Parser<T></code> | The parser to wrap | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [complete](./prsc.complete.md) | ||
|
||
## complete() function | ||
|
||
Creates a parser that applies the given parser and only succeeds (returning the inner parser's result) if parsing concludes at the end of the input string. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function complete<T>(parser: Parser<T>): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| parser | <code>Parser<T></code> | The parser to wrap | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [cut](./prsc.cut.md) | ||
|
||
## cut() function | ||
|
||
Creates a parser that turns errors returned by the inner parser into fatal errors. Parsers such as `or` and `star` will not continue to attempt additional matches if a parser returns a fatal error, and will usually return the error instead. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function cut<T>(parser: Parser<T>): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| parser | <code>Parser<T></code> | The parser to wrap | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [cut](./prsc.cut.md) | ||
|
||
## cut() function | ||
|
||
Creates a parser that turns errors returned by the inner parser into fatal errors. Parsers such as `or` and `star` will not continue to attempt additional matches if a parser returns a fatal error, and will usually return the error instead. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function cut<T>(parser: Parser<T>): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| parser | <code>Parser<T></code> | The parser to wrap | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [delimited](./prsc.delimited.md) | ||
|
||
## delimited() function | ||
|
||
Creates a Parser that applies the given parsers in sequence, returning the result value of the middle parser at the offset of the third if all are successful. If any parser fails, the error is returned as-is. | ||
|
||
Optionally makes errors by the second and third parsers fatal if `cutAfterOpen` is `true`<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function delimited<TOpen, T, TClose>(open: Parser<TOpen>, inner: Parser<T>, close: Parser<TClose>, cutAfterOpen?: boolean): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| open | <code>Parser<TOpen></code> | First parser to apply, value is discarded | | ||
| inner | <code>Parser<T></code> | Second parser to apply, value is kept | | ||
| close | <code>Parser<TClose></code> | Third parser to apply, value is discarded | | ||
| cutAfterOpen | <code>boolean</code> | If <code>true</code>, errors returned by the second and third parsers are considered fatal, causing parsers using this to stop trying other branches. | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [delimited](./prsc.delimited.md) | ||
|
||
## delimited() function | ||
|
||
Creates a Parser that applies the given parsers in sequence, returning the result value of the middle parser at the offset of the third if all are successful. If any parser fails, the error is returned as-is. | ||
|
||
Optionally makes errors by the second and third parsers fatal if `cutAfterOpen` is `true`<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function delimited<TOpen, T, TClose>(open: Parser<TOpen>, inner: Parser<T>, close: Parser<TClose>, cutAfterOpen?: boolean): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| open | <code>Parser<TOpen></code> | First parser to apply, value is discarded | | ||
| inner | <code>Parser<T></code> | Second parser to apply, value is kept | | ||
| close | <code>Parser<TClose></code> | Third parser to apply, value is discarded | | ||
| cutAfterOpen | <code>boolean</code> | If <code>true</code>, errors returned by the second and third parsers are considered fatal, causing parsers using this to stop trying other branches. | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [end](./prsc.end.md) | ||
|
||
## end variable | ||
|
||
A parser that only succeeds if the end of the input string is reached. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
end: Parser<void> | ||
``` | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [end](./prsc.end.md) | ||
|
||
## end variable | ||
|
||
A parser that only succeeds if the end of the input string is reached. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
end: Parser<void> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [error](./prsc.error.md) | ||
|
||
## error() function | ||
|
||
Creates an unsuccessful ParseResult (parse error) at the given offset. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function error<T>(offset: number, expected: string[], fatal?: boolean): ParseResult<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| offset | <code>number</code> | The offset in the input at which matching failed | | ||
| expected | <code>string[]</code> | An array of strings indicating things that were expected at offset | | ||
| fatal | <code>boolean</code> | If true, no other branches should be tried as a result of this error | | ||
|
||
<b>Returns:</b> | ||
|
||
`ParseResult<T>` | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [error](./prsc.error.md) | ||
|
||
## error() function | ||
|
||
Creates an unsuccessful ParseResult (parse error) at the given offset. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function error<T>(offset: number, expected: string[], fatal?: boolean): ParseResult<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| offset | <code>number</code> | The offset in the input at which matching failed | | ||
| expected | <code>string[]</code> | An array of strings indicating things that were expected at offset | | ||
| fatal | <code>boolean</code> | If true, no other branches should be tried as a result of this error | | ||
|
||
<b>Returns:</b> | ||
|
||
`ParseResult<T>` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [filter](./prsc.filter.md) | ||
|
||
## filter() function | ||
|
||
Creates a Parser that uses the given filter predicate to check values generated by the given parser. Values that pass the predicate are passed through, those that don't return a parse error instead. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function filter<T>(parser: Parser<T>, filter: (v: T) => boolean, expected: string[]): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| parser | <code>Parser<T></code> | Parser to filter | | ||
| filter | <code>(v: T) => boolean</code> | Predicate function over the inner parser's values | | ||
| expected | <code>string[]</code> | Expected values for parse errors generated when the filter rejects a value | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [filter](./prsc.filter.md) | ||
|
||
## filter() function | ||
|
||
Creates a Parser that uses the given filter predicate to check values generated by the given parser. Values that pass the predicate are passed through, those that don't return a parse error instead. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function filter<T>(parser: Parser<T>, filter: (v: T) => boolean, expected: string[]): Parser<T>; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| parser | <code>Parser<T></code> | Parser to filter | | ||
| filter | <code>(v: T) => boolean</code> | Predicate function over the inner parser's values | | ||
| expected | <code>string[]</code> | Expected values for parse errors generated when the filter rejects a value | | ||
|
||
<b>Returns:</b> | ||
|
||
`Parser<T>` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [first](./prsc.first.md) | ||
|
||
## first() function | ||
|
||
Returns the first of the given two arguments. Useful as a `join` function for `then`<!-- -->. See also `followed`<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function first<T1, T2>(x: T1, y: T2): T1; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| x | <code>T1</code> | Argument to return | | ||
| y | <code>T2</code> | Argument to ignore | | ||
|
||
<b>Returns:</b> | ||
|
||
`T1` | ||
|
||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [prsc](./prsc.md) > [first](./prsc.first.md) | ||
|
||
## first() function | ||
|
||
Returns the first of the given two arguments. Useful as a `join` function for `then`<!-- -->. See also `followed`<!-- -->. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function first<T1, T2>(x: T1, y: T2): T1; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| x | <code>T1</code> | Argument to return | | ||
| y | <code>T2</code> | Argument to ignore | | ||
|
||
<b>Returns:</b> | ||
|
||
`T1` | ||
|
Oops, something went wrong.