SpiseMisu.ParserCombinator
0.11.4
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.4
NuGet\Install-Package SpiseMisu.ParserCombinator -Version 0.11.4
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.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SpiseMisu.ParserCombinator --version 0.11.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SpiseMisu.ParserCombinator, 0.11.4"
#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.4 // Install SpiseMisu.ParserCombinator as a Cake Tool #tool nuget:?package=SpiseMisu.ParserCombinator&version=0.11.4
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.
Version | Downloads | Last updated |
---|---|---|
0.11.14 | 74 | 12/23/2024 |
0.11.13 | 90 | 12/19/2024 |
0.11.12 | 82 | 12/19/2024 |
0.11.11 | 79 | 12/19/2024 |
0.11.10 | 73 | 12/19/2024 |
0.11.9 | 93 | 12/7/2024 |
0.11.8 | 89 | 12/7/2024 |
0.11.7 | 189 | 5/15/2023 |
0.11.6 | 166 | 5/15/2023 |
0.11.5 | 157 | 5/15/2023 |
0.11.4 | 156 | 5/15/2023 |
0.11.3 | 171 | 5/15/2023 |
0.11.2 | 164 | 5/15/2023 |
0.11.1 | 168 | 5/14/2023 |
0.11.0 | 170 | 5/14/2023 |