Comparing version 2.0.3 to 2.0.4
{ | ||
"name": "arcsecond", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -10,3 +10,3 @@ # Arcsecond 2.0.x | ||
- [Installation](#installation) | ||
- [Tutorial](#tutorial) | ||
- [Tutorial](#tutorials) | ||
- [Usage](#usage) | ||
@@ -16,9 +16,9 @@ - [Running the examples](#running-the-examples) | ||
- [Parser Methods](#methods) | ||
- [.run](#.run) | ||
- [.fork](#.fork) | ||
- [.map](#.map) | ||
- [.chain](#.chain) | ||
- [.mapFromData](#.mapFromData) | ||
- [.chainFromData](#.chainFromData) | ||
- [.errorChain](#.errorChain) | ||
- [.run](#run) | ||
- [.fork](#fork) | ||
- [.map](#map) | ||
- [.chain](#chain) | ||
- [.mapFromData](#mapFromData) | ||
- [.chainFromData](#chainFromData) | ||
- [.errorChain](#errorChain) | ||
- [Functions](#functions) | ||
@@ -484,3 +484,3 @@ - [setData](#setData) | ||
`withData` a *provided parser*, and returns a function waiting for some *state data* to set, and then returns a new parser. That parser, when run, ensures that the *state data* is set as the *internal state data* before the *provided parser* runs. | ||
`withData` takes a *provided parser*, and returns a function waiting for some *state data* to be set, and then returns a new parser. That parser, when run, ensures that the *state data* is set as the *internal state data* before the *provided parser* runs. | ||
@@ -556,3 +556,3 @@ **Example** | ||
const selectData = selectorFn => getData.map(selectorFn); | ||
const selectState = selectorFn => getData.map(selectorFn); | ||
@@ -951,3 +951,3 @@ const parser = withData(coroutine(function* () { | ||
`sepBy` takes two parsers - a *separator* parser and a *value* parser - and returns a new parser that matches **zero or more** values from the *value* parser that are separated by values of the *separator* parser. Because it will match zero or more values, this parser will always match, resulting in an empty array in the zero case. | ||
`sepBy` takes two parsers - a *separator* parser and a *value* parser - and returns a new parser that matches **zero or more** values from the *value* parser that are separated by values of the *separator* parser. Because it will match zero or more values, this parser will *fail* if a *value* is followed by a *separator* but NOT another *value*. If there's no *value*, the result will be an empty array, not failure. | ||
@@ -1086,3 +1086,3 @@ **Example** | ||
This parser can easily be partially applied with `char ('(')` and `char (')')` to create a `betweenBrackets` parser, for example. | ||
This parser can easily be partially applied with `char ('(')` and `char (')')` to create a `betweenRoundBrackets` parser, for example. | ||
@@ -1101,5 +1101,5 @@ **Example** | ||
const betweenBrackets = between (char ('(')) (char (')')); | ||
const betweenRoundBrackets = between (char ('(')) (char (')')); | ||
betweenBrackets (many (letters)).run('(hello world)') | ||
betweenRoundBrackets (many (letters)).run('(hello world)') | ||
// -> { | ||
@@ -1113,3 +1113,2 @@ // isError: true, | ||
#### everythingUntil | ||
@@ -1587,10 +1586,7 @@ | ||
const value = toValue(result); | ||
console.log(value); | ||
// -> 'hello' | ||
} catch (parseError) { | ||
console.error(parseError.message) | ||
} | ||
resultAsPromise | ||
.then(console.log) | ||
.catch(console.error); | ||
// -> 'hello' | ||
``` | ||
@@ -1617,3 +1613,3 @@ | ||
If you're pasrsing a programming language, a configuration, or anything of sufficient complexity, it's likely that you'll need to define some parsers in terms of each other. You might want to do something like: | ||
If you're parsing a programming language, a configuration, or anything of sufficient complexity, it's likely that you'll need to define some parsers in terms of each other. You might want to do something like: | ||
@@ -1712,2 +1708,2 @@ ```JavaScript | ||
The name is also derived from parsec, which in astronomical terms is an ["astronomical unit [that] subtends an angle of one arcsecond"](https://en.wikipedia.org/wiki/Parsec). | ||
The name is also derived from parsec, which in astronomical terms is an ["astronomical unit [that] subtends an angle of one arcsecond"](https://en.wikipedia.org/wiki/Parsec). |
Sorry, the diff of this file is not supported yet
385281
3337
1699