@@ -45,7 +45,7 @@ Here is an example of a home-made parser for going back after an Accept:
4545- Construct a Tuple of values from previous accepted values
4646
4747``` js
48- let stream = Streams .ofChars (' abc' )
48+ let stream = Stream .ofChars (' abc' )
4949const charsParser = C .char (' a' )
5050 .then (C .char (' b' ))
5151 .then (C .char (' c' ))
@@ -59,7 +59,7 @@ assertEquals(parsing.value, 'abc')
5959- Uses ` then() ` and returns only the left or right value
6060
6161``` js
62- const stream = Streams .ofChars (' |4.6|' )
62+ const stream = Stream .ofChars (' |4.6|' )
6363const floorCombinator = C .char (' |' )
6464 .drop ()
6565 .then (N .number ()) // we have ['|',4.6], we keep 4.6
@@ -78,7 +78,7 @@ assertEquals(4, parsing.value, 'Floor parsing')
7878- Change the value of the response
7979
8080``` js
81- const stream = Streams .ofChars (' 5x8' )
81+ const stream = Stream .ofChars (' 5x8' )
8282const combinator = N .integer ()
8383 .then (C .charIn (' x*' ).drop ())
8484 .then (N .integer ())
@@ -93,7 +93,7 @@ assertEquals(combinator.val(stream), 40)
9393- It's a simplification of map
9494
9595``` js
96- const stream = Streams .ofChars (' ab' )
96+ const stream = Stream .ofChars (' ab' )
9797// given 'ac', value should be ['X' , 'c']
9898const combinator = C .char (' a' ).returns (' X' ).then (C .char (' b' ))
9999assertEquals (combinator .val (stream).array (), [' X' , ' b' ])
@@ -142,7 +142,7 @@ C.char('a').opt(C.char('b')).char('c')
142142- Ensure a parser is repeated ** at least** one time
143143
144144``` js
145- const stream = Streams .ofChars (' aaa' )
145+ const stream = Stream .ofChars (' aaa' )
146146const parsing = C .char (' a' ).rep ().parse (stream)
147147test .ok (parsing .isAccepted ())
148148// We need to call list.array()
@@ -187,7 +187,7 @@ while testing or().
187187const eater = C .char (' a' ).then (C .char (' a' ))
188188const parser = eater .or (C .char (' b' ))
189189
190- const stream = Streams .ofChars (' ab' )
190+ const stream = Stream .ofChars (' ab' )
191191const parsing = parser .parse (stream)
192192expect (parsing .isAccepted ()).toBe (false )
193193expect (parsing .offset ).toBe (1 ) // ✨ this is the point ! one 'a' is consumed
@@ -272,16 +272,16 @@ It can help you to read your document knowing what happen previously
272272
273273 'expect (filter) to be accepted': function(test) {
274274 test.equal(parser.char("a").filter(a => a === 'a')
275- .parse(Streams .ofChars("a")).isAccepted(), true, 'should be accepted.');
275+ .parse(Stream .ofChars("a")).isAccepted(), true, 'should be accepted.');
276276 }
277277
278278### match (matchValue)
279279
280280- Simplification of ` filter() `
281281- Check if the stream value is equal to the _ matchValue_
282282
283- //given 123
284- N.number().match(123)
283+ //given 123
284+ N.number().match(123)
285285
286286### error()
287287
0 commit comments