SpiseMisu.ParserCombinator
0.11.5
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package SpiseMisu.ParserCombinator --version 0.11.5
NuGet\Install-Package SpiseMisu.ParserCombinator -Version 0.11.5
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.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SpiseMisu.ParserCombinator --version 0.11.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SpiseMisu.ParserCombinator, 0.11.5"
#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.5 // Install SpiseMisu.ParserCombinator as a Cake Tool #tool nuget:?package=SpiseMisu.ParserCombinator&version=0.11.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.04"
#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 | Versions 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.
-
net6.0
- FSharp.Core (>= 6.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.