File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1
1
import either , { type Either } from '@matt.kantor/either'
2
2
import { nothing } from './constructors.js'
3
3
import type {
4
- AlwaysSucceedingParser ,
5
4
InvalidInputError ,
6
5
Parser ,
6
+ ParserWhichAlwaysSucceeds ,
7
7
Success ,
8
8
} from './parser.js'
9
9
@@ -212,7 +212,9 @@ export const transformOutput =
212
212
* Outputs are collected in an array.
213
213
*/
214
214
export const zeroOrMore =
215
- < Output > ( parser : Parser < Output > ) : AlwaysSucceedingParser < readonly Output [ ] > =>
215
+ < Output > (
216
+ parser : Parser < Output > ,
217
+ ) : ParserWhichAlwaysSucceeds < readonly Output [ ] > =>
216
218
input => {
217
219
const result = oneOf ( [ parser , nothing ] ) ( input )
218
220
const success = either . match ( result , {
Original file line number Diff line number Diff line change 1
1
import either from '@matt.kantor/either'
2
- import type { AlwaysSucceedingParser , Parser } from './parser.js'
2
+ import type { Parser , ParserWhichAlwaysSucceeds } from './parser.js'
3
3
4
4
export const anySingleCharacter : Parser < string > = input => {
5
5
const firstCodePoint = input . codePointAt ( 0 )
@@ -30,7 +30,7 @@ export const literal =
30
30
message : `input did not begin with \`${ text } \`` ,
31
31
} )
32
32
33
- export const nothing : AlwaysSucceedingParser < undefined > = input =>
33
+ export const nothing : ParserWhichAlwaysSucceeds < undefined > = input =>
34
34
either . makeRight ( {
35
35
remainingInput : input ,
36
36
output : undefined ,
Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ export type Parser<Output> = (
14
14
input : string ,
15
15
) => Either < InvalidInputError , Success < Output > >
16
16
17
- export type AlwaysSucceedingParser < Output > = (
17
+ export type ParserWhichAlwaysSucceeds < Output > = (
18
18
input : string ,
19
19
) => Right < Success < Output > >
You can’t perform that action at this time.
0 commit comments