SpiseMisu.ParserCombinator 0.11.7

dotnet add package SpiseMisu.ParserCombinator --version 0.11.7                
NuGet\Install-Package SpiseMisu.ParserCombinator -Version 0.11.7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpiseMisu.ParserCombinator" Version="0.11.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SpiseMisu.ParserCombinator --version 0.11.7                
#r "nuget: SpiseMisu.ParserCombinator, 0.11.7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install SpiseMisu.ParserCombinator as a Cake Addin
#addin nuget:?package=SpiseMisu.ParserCombinator&version=0.11.7

// Install SpiseMisu.ParserCombinator as a Cake Tool
#tool nuget:?package=SpiseMisu.ParserCombinator&version=0.11.7                

SpiseMisu.ParserCombinator

Efficient CharStream parser-combinator in F#

Demo

(* This construct is for ML compatibility. The syntax '(typ,...,typ) ident'
   is not used in F# code. Consider using 'ident<typ,...,typ>' instead. *)
#nowarn "62"

#r "nuget: SpiseMisu.ParserCombinator, 00.11.07"

#time "on"

open System

open SpiseMisu.Parser
open SpiseMisu.Parser.Converters
open SpiseMisu.Parser.Combinator

module rec FooBar =
  
  type t =
    | Foo of t seq
    | Bar of int
  
  let foobarP () =
        barP
    <|> fooP
  
  let barP =
    ( Chars.toInt >> Bar
    )
    <!> numsP
  
  let foobarsP =
    sepBy
      ( defer foobarP )
      ( manyP spaceP *> charP ',' <* manyP spaceP )
  
  let fooP =
    ( Foo
    )
    <!> charP '[' *> manyP spaceP *> foobarsP <* manyP spaceP <* charP ']'

open FooBar

let _ =
  
  "[\t00, [ \n1337,2     , 42]     ]"
  
  (* Should be parsed as:
     > Foo (seq [Bar 0; Foo (seq [Bar 1337; Bar 2; Bar 42])])
  *)
  
  |> run (defer foobarP)
  |> function
    | Ok    a -> printfn "# Parse:\n%A" a
    | Error e -> printfn "# Error:\n%s" e
  
  0

NOTE: The demo script is available at: ./demo/foobar.fsx.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.11.7 184 5/15/2023
0.11.6 161 5/15/2023
0.11.5 152 5/15/2023
0.11.4 151 5/15/2023
0.11.3 166 5/15/2023
0.11.2 159 5/15/2023
0.11.1 163 5/14/2023
0.11.0 165 5/14/2023