static member Default = { line=0; column=0}
type Parser<'t> = Parser<'t, UserState>
match runParserOnString p UserState.Default "" str with
| Success(result, s, a) -> printfn "Success: %A" result
| Failure(errorMsg, s, a) -> printfn "Failure: msg: %s \ns:%A \na:%A" errorMsg s a
let str_ws s = pstring s .>> ws
let float_ws = pfloat .>> ws
let numberList = str_ws "[" >>. sepBy float_ws (str_ws ",") .>> str_ws "]"
test numberList @"[ 1 , 2 ] "
test (many (str "a" <|> str "b")) "abba"
test (skipStringCI "<float>" >>. pfloat) "<FLOAT>1.0"
let isIdentifierFirstChar c = isLetter c || c = '_'
let isIdentifierChar c = isLetter c || isDigit c || c = '_'
many1Satisfy2L isIdentifierFirstChar isIdentifierChar "identifier" .>> ws
test identifier "_this_is_also_&_not_an_identifier"