Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed functions to make them generally shorter and and more familia…

…r to other parser libraries. skipItem -> item -> token, itemEqual -> matchToken, itemsEqual -> matchTokens, repeatUntil -> until, skip, skipItems -> skips, etc.
  • Loading branch information...
commit f0ab824010a5d3b2c4f40a80a1b2aad9437ffbcb 1 parent ec16130
@panesofglass panesofglass authored
View
70 src/Cashel.Peg/peg.fs
@@ -150,20 +150,20 @@ module Peg =
///EndOfLine <- '\r\n' / '\n' / '\r'
let EndOfLine = parser {
- return! itemsEqual (List.ofSeq "\r\n")
- return! itemEqual '\n' |> listify
- return! itemEqual '\r' |> listify }
+ return! matchTokens (List.ofSeq "\r\n")
+ return! matchToken '\n' |> listify
+ return! matchToken '\r' |> listify }
///Space <- ' ' / '\t' / EndOfLine
let Space = parser {
- return! itemEqual ' ' |> listify
- return! itemEqual '\t' |> listify
+ return! matchToken ' ' |> listify
+ return! matchToken '\t' |> listify
return! EndOfLine }
///Comment <- '#' (!EndOfLine .)* EndOfLine
let Comment = parser {
- do! skipItem '#'
- let! c = repeatUntil item EndOfLine
+ do! skip '#'
+ let! c = until token EndOfLine
return c }
///Spacing <- (Space / Comment)*
@@ -172,42 +172,42 @@ module Peg =
return! Comment } |> repeat
///DOT <- '.' Spacing
- let DOT = itemEqual '.' .>> Spacing
+ let DOT = matchToken '.' .>> Spacing
///SLASH <- '/' Spacing
- let SLASH = itemEqual '/' .>> Spacing
+ let SLASH = matchToken '/' .>> Spacing
///AND <- '&' Spacing
- let AND = itemEqual '&' .>> Spacing
+ let AND = matchToken '&' .>> Spacing
///NOT <- '!' Spacing
- let NOT = itemEqual '!' .>> Spacing
+ let NOT = matchToken '!' .>> Spacing
///QUESTION <- '?' Spacing
- let QUESTION = itemEqual '?' .>> Spacing
+ let QUESTION = matchToken '?' .>> Spacing
///STAR <- '*' Spacing
- let STAR = itemEqual '*' .>> Spacing
+ let STAR = matchToken '*' .>> Spacing
///PLUS <- '+' Spacing
- let PLUS = itemEqual '+' .>> Spacing
+ let PLUS = matchToken '+' .>> Spacing
///OPEN <- '(' Spacing
- let OPEN = itemEqual '(' .>> Spacing
+ let OPEN = matchToken '(' .>> Spacing
///CLOSE <- ')' Spacing
- let CLOSE = itemEqual ')' .>> Spacing
+ let CLOSE = matchToken ')' .>> Spacing
///LEFTARROW <- '<-' Spacing
- let LEFTARROW = itemsEqual (List.ofSeq "<-") .>> Spacing
+ let LEFTARROW = matchTokens (List.ofSeq "<-") .>> Spacing
///Char <- '\\' [nrt'""\[\]\\] / '\\' [0-2][0-7][0-7] / '\\' [0-7][0-7]? / !'\\' .
let Char =
let c2i c = int c - int '0'
parser {
- do! skipItem '\\'
- let! c = anyOf ['n';'r';'t';'''; '"'; '['; ']'; '\\']
+ do! skip '\\'
+ let! c = any ['n';'r';'t';'''; '"'; '['; ']'; '\\']
match c with
| 'n' -> return '\n'
| 'r' -> return '\r'
@@ -215,29 +215,29 @@ module Peg =
| _ -> return c }
+++
parser {
- do! skipItem '\\'
- let! c1 = anyOf ['0'..'2']
- let! c2 = anyOf ['0'..'7']
- let! c3 = anyOf ['0'..'7']
+ do! skip '\\'
+ let! c1 = any ['0'..'2']
+ let! c2 = any ['0'..'7']
+ let! c3 = any ['0'..'7']
return char ((c2i c1)*64 + (c2i c2)*8 + (c2i c3)) }
+++
parser {
- do! skipItem '\\'
- let! c1 = anyOf ['0'..'7']
- let! c2 = !? (anyOf ['0'..'7'])
+ do! skip '\\'
+ let! c1 = any ['0'..'7']
+ let! c2 = !? (any ['0'..'7'])
match c2 with
| Some(c2) -> return char ((c2i c1)*8 + (c2i c2))
| None -> return char (c2i c1) }
+++
parser {
- do! !~ (itemEqual '\\')
- return! item }
+ do! !~ (matchToken '\\')
+ return! token }
///Range <- Char '-' Char / Char
let Range =
parser {
let! c1 = Char
- do! skipItem '-'
+ do! skip '-'
let! c2 = Char
return Dual(c1, c2) }
+++
@@ -248,8 +248,8 @@ module Peg =
///Class <- '[' (!']' Range)* ']' Spacing
let Class =
parser {
- do! skipItem '['
- let! rl = repeatUntil Range (itemEqual ']')
+ do! skip '['
+ let! rl = until Range (matchToken ']')
do! forget Spacing
return rl
}
@@ -257,8 +257,8 @@ module Peg =
///Literal <- ['] (!['] Char)* ['] Spacing / ["] (!["] Char)* [""] Spacing
let Literal =
let literal_workhorse ch = parser {
- do! skipItem ch
- let! cl = repeatUntil Char (itemEqual ch)
+ do! skip ch
+ let! cl = until Char (matchToken ch)
do! forget Spacing
return cl }
literal_workhorse ''' +++ literal_workhorse '"'
@@ -268,8 +268,8 @@ module Peg =
//IdentStart <- [a-zA-Z_]
//IdentCont <- IdentStart / [0-9]
let Identifier =
- let IdentStart = anyOf (['a'..'z']@['A'..'Z']@['_'])
- let IdentCont = IdentStart +++ anyOf ['0'..'9']
+ let IdentStart = any (['a'..'z']@['A'..'Z']@['_'])
+ let IdentCont = IdentStart +++ any ['0'..'9']
parser {
let! c = IdentStart
View
80 src/Cashel.Peg/peg2.fs
@@ -196,30 +196,30 @@ module Peg2 =
open Cashel
open Cashel.ListPrimitives
- let _EndOfFile = !~ item
+ let _EndOfFile = !~ token
///EndOfLine <- '\r\n' / '\n' / '\r'
let _EndOfLine = parser {
- return! itemsEqual (List.ofSeq "\r\n")
- return! itemEqual '\n' |> listify
- return! itemEqual '\r' |> listify } |> forget
+ return! matchTokens (List.ofSeq "\r\n")
+ return! matchToken '\n' |> listify
+ return! matchToken '\r' |> listify } |> forget
///Space <- ' ' / '\t' / EndOfLine
let _Space = parser {
- return! itemEqual ' ' |> forget
- return! itemEqual '\t' |> forget
+ return! matchToken ' ' |> forget
+ return! matchToken '\t' |> forget
return! _EndOfLine } |> forget
///SlashComment <- '//' (!EndOfLine .)* EndOfLine
let _SlashComment = parser {
- do! skipItems ['/';'/']
- do! repeatUntil item _EndOfLine |> forget
+ do! skips ['/';'/']
+ do! until token _EndOfLine |> forget
return () }
///Comment <- '#' (!EndOfLine .)* EndOfLine
let _Comment = parser {
- do! skipItem '#'
- do! repeatUntil item _EndOfLine |> forget
+ do! skip '#'
+ do! until token _EndOfLine |> forget
return () }
///Spacing <- (Space / Comment)*
@@ -229,58 +229,58 @@ module Peg2 =
return! _Comment } |> repeat)
let parse p = _Spacing >>. p
- let token p = forget (p .>> _Spacing)
+ let forgottenToken p = forget (p .>> _Spacing)
///DOT <- '.' Spacing
- let _DOT = token (itemEqual '.')
+ let _DOT = forgottenToken (matchToken '.')
///OPEN <- '(' Spacing
- let _OPAREN = token (itemEqual '(')
+ let _OPAREN = forgottenToken (matchToken '(')
///CLOSE <- ')' Spacing
- let _CPAREN = token (itemEqual ')')
+ let _CPAREN = forgottenToken (matchToken ')')
///AND <- '&' Spacing
- let _AND = token (itemEqual '&')
+ let _AND = forgottenToken (matchToken '&')
///NOT <- '!' Spacing
- let _NOT = token (itemEqual '!')
+ let _NOT = forgottenToken (matchToken '!')
///QUESTION <- '?' Spacing
- let _QUESTION = token (itemEqual '?')
+ let _QUESTION = forgottenToken (matchToken '?')
///STAR <- '*' Spacing
- let _STAR = token (itemEqual '*')
+ let _STAR = forgottenToken (matchToken '*')
///PLUS <- '+' Spacing
- let _PLUS = token (itemEqual '+')
+ let _PLUS = forgottenToken (matchToken '+')
///COLON <- ':' Spacing
- let _COLON = token (itemEqual ':')
+ let _COLON = forgottenToken (matchToken ':')
///SEMICOLON <- ';' Spacing
- let _SEMICOLON = token (itemEqual ';')
+ let _SEMICOLON = forgottenToken (matchToken ';')
///RIGHTARROW <- '=>' Spacing
- let _RIGHTARROW = token (itemsEqual (List.ofSeq "=>"))
+ let _RIGHTARROW = forgottenToken (matchTokens (List.ofSeq "=>"))
///SLASH <- '/' Spacing
- let _SLASH = token (itemEqual '/')
+ let _SLASH = forgottenToken (matchToken '/')
///OPEN <- '(' Spacing
- let _OCURLY = token (itemEqual '{')
+ let _OCURLY = forgottenToken (matchToken '{')
///CLOSE <- ')' Spacing
- let _CCURLY = token (itemEqual '}')
+ let _CCURLY = forgottenToken (matchToken '}')
///LEFTARROW <- '<-' Spacing
- let _LEFTARROW = token (itemsEqual (List.ofSeq "<-"))
+ let _LEFTARROW = forgottenToken (matchTokens (List.ofSeq "<-"))
///Char <- '\\' [nrt'""\[\]\\] / '\\u' [a-fA-F0-9] [a-fA-F0-9] [a-fA-F0-9] [a-fA-F0-9] / !'\\' .
let _Char =
///HexDigit <- [a-fA-F0-9]
- let _HexDigit = anyOf (['a'..'f'] @ ['A'..'F'] @ ['0'..'9'])
+ let _HexDigit = any (['a'..'f'] @ ['A'..'F'] @ ['0'..'9'])
let hex2int c =
let c = System.Char.ToUpper(c)
@@ -289,8 +289,8 @@ module Peg2 =
else failwith "Invalid Hex Digit"
parser {
- do! skipItem '\\'
- let! c = anyOf ['n';'r';'t';'''; '"'; '['; ']'; '\\']
+ do! skip '\\'
+ let! c = any ['n';'r';'t';'''; '"'; '['; ']'; '\\']
match c with
| 'n' -> return '\n'
| 'r' -> return '\r'
@@ -298,8 +298,8 @@ module Peg2 =
| _ -> return c }
+++
parser {
- do! skipItem '\\'
- do! skipItem 'u'
+ do! skip '\\'
+ do! skip 'u'
let! h1 = _HexDigit
let! h2 = _HexDigit
let! h3 = _HexDigit
@@ -307,14 +307,14 @@ module Peg2 =
return char ((hex2int h1)*4096 + (hex2int h2)*256 + (hex2int h3)*16 + (hex2int h4)) }
+++
parser {
- do! !~ (itemEqual '\\')
- return! item }
+ do! !~ (matchToken '\\')
+ return! token }
///Range <- Char '-' Char / Char
let _Range =
parser {
let! c1 = _Char
- do! skipItem '-'
+ do! skip '-'
let! c2 = _Char
return Dual(c1, c2) }
+++
@@ -325,8 +325,8 @@ module Peg2 =
///Class <- '[' (!']' Range)* ']' Spacing
let _Class =
parser {
- do! skipItem '['
- let! rl = repeatUntil _Range (itemEqual ']')
+ do! skip '['
+ let! rl = until _Range (matchToken ']')
do! forget _Spacing
return rl
}
@@ -335,8 +335,8 @@ module Peg2 =
let _Literal =
let literalWorkhorse ch =
parser {
- do! skipItem ch
- let! cl = repeatUntil _Char (itemEqual ch)
+ do! skip ch
+ let! cl = until _Char (matchToken ch)
do! forget _Spacing
return List2String cl }
literalWorkhorse ''' +++ literalWorkhorse '"'
@@ -345,8 +345,8 @@ module Peg2 =
///Identifier <- [a-zA-Z_] ([_a-zA-Z0-9])* Spacing
let _Identifier =
parser {
- let! c = anyOf (['_'] @ ['a'..'z'] @ ['A'..'Z'])
- let! cs = repeat (anyOf (['_'] @ ['a'..'z'] @ ['A'..'Z'] @ ['0'..'9']))
+ let! c = any (['_'] @ ['a'..'z'] @ ['A'..'Z'])
+ let! cs = repeat (any (['_'] @ ['a'..'z'] @ ['A'..'Z'] @ ['0'..'9']))
do! forget _Spacing
return List2String (c::cs) }
View
112 src/Cashel.Tests/primitives_test.fs
@@ -8,64 +8,64 @@ open FsUnit
open Cashel
[<Test>]
-let test_item () =
+let test_token () =
let exp = Some('t', !!"est")
- item !!"test" |> should equal exp
+ token !!"test" |> should equal exp
[<Test>]
-let test_item_empty_list () =
- item [] |> should equal None
+let test_token_empty_list () =
+ token [] |> should equal None
[<Test>]
-let test_item_single_item () =
+let test_token_single_token () =
let exp = Some('t', [])
- item ['t'] |> should equal exp
+ token ['t'] |> should equal exp
[<Test>]
-let test_ignore_with_item () =
+let test_ignore_with_token () =
let exp = Some((), !!"est")
- forget item !!"test" |> should equal exp
+ forget token !!"test" |> should equal exp
[<Test>]
-let test_listify_with_item () =
+let test_listify_with_token () =
let exp = Some(['t'], !!"est")
- listify item !!"test" |> should equal exp
+ listify token !!"test" |> should equal exp
[<Test>]
let test_satisy_simple_predicate () =
let exp = Some('t', !!"est")
- satisfy item (fun x -> x = 't') !!"test" |> should equal exp
+ satisfy token (fun x -> x = 't') !!"test" |> should equal exp
[<Test>]
let test_satisy_failure_predicate () =
- satisfy item (fun x -> x = 'e') !!"test" |> should equal None
+ satisfy token (fun x -> x = 'e') !!"test" |> should equal None
open Cashel.ListPrimitives
[<Test>]
-let test_anyOf_success_predicate () =
- anyOf ['q'..'v'] !!"test" |> should equal (Some('t', !!"est"))
+let test_any_success_predicate () =
+ any ['q'..'v'] !!"test" |> should equal (Some('t', !!"est"))
[<Test>]
-let test_anyOf_failure_predicate () =
- anyOf ['a'..'e'] !!"test" |> should equal None
+let test_any_failure_predicate () =
+ any ['a'..'e'] !!"test" |> should equal None
[<Test>]
-let test_itemEqual () =
- itemEqual 't' !!"test" |> should equal (Some('t', !!"est"))
+let test_matchToken () =
+ matchToken 't' !!"test" |> should equal (Some('t', !!"est"))
[<Test>]
-let test_itemEqual_failure () =
- itemEqual 'e' !!"test" |> should equal None
+let test_matchToken_failure () =
+ matchToken 'e' !!"test" |> should equal None
[<Test>]
-let test_itemsEqual () =
- itemsEqual !!"test" !!"test me" |> should equal (Some(!!"test", !!" me"))
+let test_matchTokens () =
+ matchTokens !!"test" !!"test me" |> should equal (Some(!!"test", !!" me"))
[<Test>]
-let test_itemsEqual_failue () =
- itemsEqual !!"test" !!"tesp me" |> should equal None
+let test_matchTokens_failue () =
+ matchTokens !!"test" !!"tesp me" |> should equal None
[<Test>]
let test_eof () =
@@ -77,105 +77,105 @@ let test_eof_fails_not_at_end () =
[<Test>]
let test_repeat () =
- repeat (itemEqual 't') !!"ttttest" |> should equal (Some(!!"tttt", !!"est"))
+ repeat (matchToken 't') !!"ttttest" |> should equal (Some(!!"tttt", !!"est"))
[<Test>]
let test_repeat_one_match() =
- repeat (itemEqual 't') !!"test" |> should equal (Some(['t'], !!"est"))
+ repeat (matchToken 't') !!"test" |> should equal (Some(['t'], !!"est"))
[<Test>]
let test_repeat_no_matches () =
- repeat (itemEqual 'e') !!"ttttest" |> should equal (Some([], !!"ttttest"))
+ repeat (matchToken 'e') !!"ttttest" |> should equal (Some([], !!"ttttest"))
[<Test>]
let test_repeat1 () =
- repeat1 (itemEqual 't') !!"ttttest" |> should equal (Some(!!"tttt", !!"est"))
+ repeat1 (matchToken 't') !!"ttttest" |> should equal (Some(!!"tttt", !!"est"))
[<Test>]
let test_repeat1_one_match() =
- repeat1 (itemEqual 't') !!"test" |> should equal (Some(['t'], !!"est"))
+ repeat1 (matchToken 't') !!"test" |> should equal (Some(['t'], !!"est"))
[<Test>]
let test_repeat1_no_matches () =
- repeat1 (itemEqual 'e') !!"ttttest" |> should equal None
+ repeat1 (matchToken 'e') !!"ttttest" |> should equal None
[<Test>]
let test_failure_predicate_parser_success() =
- !~ (itemEqual 't') !!"test" |> should equal None
+ !~ (matchToken 't') !!"test" |> should equal None
[<Test>]
let test_failure_predicate_parser_fails () =
- !~ (itemEqual 'e') !!"test" |> should equal (Some((), !!"test"))
+ !~ (matchToken 'e') !!"test" |> should equal (Some((), !!"test"))
[<Test>]
let test_Success_predicate_parser_success() =
- !& (itemEqual 't') !!"test" |> should equal (Some((), !!"test"))
+ !& (matchToken 't') !!"test" |> should equal (Some((), !!"test"))
[<Test>]
let test_success_predicate_parser_fails () =
- !& (itemEqual 'e') !!"test" |> should equal None
+ !& (matchToken 'e') !!"test" |> should equal None
[<Test>]
let test_option_predicate_one () =
- !? (itemEqual 't') !!"test" |> should equal (Some(Some('t'), !!"est"))
+ !? (matchToken 't') !!"test" |> should equal (Some(Some('t'), !!"est"))
[<Test>]
let test_option_predicate_zero () =
- !? (itemEqual 'e') !!"test" |> should equal (Some(None, !!"test"))
+ !? (matchToken 'e') !!"test" |> should equal (Some(None, !!"test"))
[<Test>]
let test_ignore_left () =
- ((itemEqual 't') .>> (itemEqual 'e')) !!"test" |> should equal (Some('t', !!"st"))
+ ((matchToken 't') .>> (matchToken 'e')) !!"test" |> should equal (Some('t', !!"st"))
[<Test>]
let test_ignore_left_fails () =
- ((itemEqual 'e') .>> (itemEqual 'e')) !!"test" |> should equal None
+ ((matchToken 'e') .>> (matchToken 'e')) !!"test" |> should equal None
[<Test>]
let test_ignore_right () =
- ((itemEqual 't') >>. (itemEqual 'e')) !!"test" |> should equal (Some('e', !!"st"))
+ ((matchToken 't') >>. (matchToken 'e')) !!"test" |> should equal (Some('e', !!"st"))
[<Test>]
let test_ignore_right_fails () =
- ((itemEqual 't') >>. (itemEqual 's')) !!"test" |> should equal None
+ ((matchToken 't') >>. (matchToken 's')) !!"test" |> should equal None
[<Test>]
let test_parse_return_value () =
- ((itemEqual 't') >>! "hello") !!"test" |> should equal (Some("hello", !!"est"))
+ ((matchToken 't') >>! "hello") !!"test" |> should equal (Some("hello", !!"est"))
[<Test>]
let test_parse_return_value_fails () =
- ((itemEqual 'q') >>! "hello") !!"test" |> should equal None
+ ((matchToken 'q') >>! "hello") !!"test" |> should equal None
[<Test>]
-let test_repeatUntil () =
- (repeatUntil item (itemEqual 's')) !!"test" |> should equal (Some(!!"te", !!"t"))
+let test_until () =
+ (until token (matchToken 's')) !!"test" |> should equal (Some(!!"te", !!"t"))
[<Test>]
-let test_repeatUntil_fail_1 () =
- (repeatUntil item (itemEqual 'q')) !!"test" |> should equal None
+let test_until_fail_1 () =
+ (until token (matchToken 'q')) !!"test" |> should equal None
[<Test>]
-let test_repeatUntil_fail_2 () =
- (repeatUntil (itemEqual 'q') (itemEqual 's')) !!"test" |> should equal None
+let test_until_fail_2 () =
+ (until (matchToken 'q') (matchToken 's')) !!"test" |> should equal None
[<Test>]
-let test_skipItem () =
+let test_skip () =
let exp = Some((), !!"est")
- skipItem 't' !!"test" |> should equal exp
+ skip 't' !!"test" |> should equal exp
[<Test>]
-let test_skipItem_fail () =
- skipItem 'e' !!"test" |> should equal None
+let test_skip_fail () =
+ skip 'e' !!"test" |> should equal None
[<Test>]
-let test_skipItems () =
+let test_skips () =
let exp = Some((), !!"st")
- skipItems !!"te" !!"test" |> should equal exp
+ skips !!"te" !!"test" |> should equal exp
[<Test>]
-let test_skipItems_fail () =
- skipItems !!"ts" !!"test" |> should equal None
+let test_skips_fail () =
+ skips !!"ts" !!"test" |> should equal None
open Cashel.CharListPrimitives
View
8 src/Cashel/CharListPrimitives.fs
@@ -14,10 +14,10 @@ module CharListPrimitives =
| [] -> []
worker cl 1 1
- let lowercase = anyOf ['a'..'z']
- let uppercase = anyOf ['A'..'Z']
+ let lowercase = any ['a'..'z']
+ let uppercase = any ['A'..'Z']
let letter = lowercase +++ uppercase
- let digit = anyOf ['0'..'9']
+ let digit = any ['0'..'9']
let digitval = digit >>= (fun d -> result (int d - int '0'))
- let space = satisfy item (System.Char.IsWhiteSpace)
+ let space = satisfy token (System.Char.IsWhiteSpace)
let skipSpace = repeat space |> forget
View
26 src/Cashel/ListPrimitives.fs
@@ -5,8 +5,8 @@ module ListPrimitives =
open Cashel
//-------------------------List primitives-------------------------------------------
- ///item assumes the input is a list and returns a tuple of the head and tail
- let item : Parser<'a list, 'a> =
+ ///token assumes the input is a list and returns a tuple of the head and tail
+ let token : Parser<'a list, 'a> =
fun input ->
match input with
| x::xs -> Some(x,xs)
@@ -19,20 +19,20 @@ module ListPrimitives =
| [] -> Some((), [])
| _ -> None
- ///anyOf checks the value at the start of the input is in the list of items l
- let anyOf l = satisfy item (fun x -> l |> List.exists (fun y -> x = y))
+ ///any checks the value at the start of the input is in the list of tokens l
+ let any l = satisfy token (fun x -> l |> List.exists (fun y -> x = y))
- ///itemEqual checks the value at the start of the input matches the value v
- let itemEqual v = satisfy item (fun x -> x = v)
+ ///matchToken checks the value at the start of the input matches the value v
+ let matchToken v = satisfy token (fun x -> x = v)
- ///itemsEqual recursively uses itemEqual to check to see if a list of values l matches the start of the input
- let rec itemsEqual l =
+ ///matchTokens recursively uses matchToken to check to see if a list of values l matches the start of the input
+ let rec matchTokens l =
match l with
| [] -> result []
- | x::xs -> itemEqual x >>= (fun i -> itemsEqual xs >>= (fun is -> result (i::is)))
+ | x::xs -> matchToken x >>= (fun i -> matchTokens xs >>= (fun is -> result (i::is)))
- ///skipItem calls itemEqual but tosses the parse value
- let skipItem v = itemEqual v |> forget
+ ///skip calls matchToken but tosses the parse value
+ let skip v = matchToken v |> forget
- ///skipItems calls itemsEqual but tosses the parse value
- let skipItems l = itemsEqual l |> forget
+ ///skips calls matchTokens but tosses the parse value
+ let skips l = matchTokens l |> forget
View
3  src/Cashel/parser.fs
@@ -38,7 +38,4 @@ module Parser =
member w.Combine(p1,p2) = p1 +++ p2
let parser = ParserBuilder()
-
-
-
View
4 src/Cashel/primitives.fs
@@ -52,6 +52,6 @@ module Primitives =
| Some(v,input') -> Some(Some(v),input')
| None -> Some(None, input)
- ///repeatUntil calls p1 repeatedly until p2 succeeds
- let repeatUntil p1 p2 = repeat (!~ p2 >>. p1) .>> p2
+ ///until calls p1 repeatedly until p2 succeeds
+ let until p1 p2 = repeat (!~ p2 >>. p1) .>> p2
Please sign in to comment.
Something went wrong with that request. Please try again.