Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
gcanti committed Sep 13, 2020
1 parent 571d441 commit 1944379
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions docs/modules/Parser.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ export declare const lookAhead: <I, A>(p: Parser<I, A>) => Parser<I, A>
**Example**

```ts
import { run } from 'parser-ts/lib/code-frame'
import * as P from 'parser-ts/lib/Parser'
import * as S from 'parser-ts/lib/string'
import { run } from 'parser-ts/code-frame'
import * as P from 'parser-ts/Parser'
import * as S from 'parser-ts/string'
const parser = S.fold([S.string('hello '), P.lookAhead(S.string('world')), S.string('wor')])
Expand Down Expand Up @@ -440,9 +440,9 @@ export declare const takeUntil: <I>(predicate: Predicate<I>) => Parser<I, I[]>
**Example**

```ts
import * as C from 'parser-ts/lib/char'
import { run } from 'parser-ts/lib/code-frame'
import * as P from 'parser-ts/lib/Parser'
import * as C from 'parser-ts/char'
import { run } from 'parser-ts/code-frame'
import * as P from 'parser-ts/Parser'
const parser = P.takeUntil((c: C.Char) => c === 'w')
Expand Down
12 changes: 6 additions & 6 deletions src/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ export const surroundedBy: <I, A>(bound: Parser<I, A>) => <B>(p: Parser<I, B>) =
* Takes a `Parser` and tries to match it without consuming any input.
*
* @example
* import { run } from 'parser-ts/lib/code-frame'
* import * as P from 'parser-ts/lib/Parser'
* import * as S from 'parser-ts/lib/string'
* import { run } from 'parser-ts/code-frame'
* import * as P from 'parser-ts/Parser'
* import * as S from 'parser-ts/string'
*
* const parser = S.fold([
* S.string('hello '),
Expand All @@ -364,9 +364,9 @@ export const lookAhead: <I, A>(p: Parser<I, A>) => Parser<I, A> = p => i =>
* Takes a `Predicate` and continues parsing until the given `Predicate` is satisfied.
*
* @example
* import * as C from 'parser-ts/lib/char'
* import { run } from 'parser-ts/lib/code-frame'
* import * as P from 'parser-ts/lib/Parser'
* import * as C from 'parser-ts/char'
* import { run } from 'parser-ts/code-frame'
* import * as P from 'parser-ts/Parser'
*
* const parser = P.takeUntil((c: C.Char) => c === 'w')
*
Expand Down

0 comments on commit 1944379

Please sign in to comment.