mirror of
https://github.com/Smaug123/WoofWare.PrattParser
synced 2025-10-05 01:18:42 +00:00
Split out into an example
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace PrattParser
|
||||
namespace ParseExample
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
type Expr =
|
@@ -1,7 +1,8 @@
|
||||
namespace PrattParser
|
||||
namespace ParseExample
|
||||
|
||||
open System
|
||||
open System.Globalization
|
||||
open PrattParser
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Example =
|
@@ -1,4 +1,4 @@
|
||||
namespace PrattParser
|
||||
namespace ParseExample
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Lexer =
|
18
PrattParser.Example/PrattParser.Example.fsproj
Normal file
18
PrattParser.Example/PrattParser.Example.fsproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Domain.fs" />
|
||||
<Compile Include="Lexer.fs" />
|
||||
<Compile Include="Example.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PrattParser\PrattParser.fsproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@@ -22,6 +22,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PrattParser.Example\PrattParser.Example.fsproj" />
|
||||
<ProjectReference Include="..\PrattParser\PrattParser.fsproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
namespace PrattParser.Test
|
||||
|
||||
open PrattParser
|
||||
open ParseExample
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
namespace PrattParser.Test
|
||||
|
||||
open ParseExample
|
||||
open PrattParser
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
|
@@ -4,6 +4,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PrattParser", "PrattParser\
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PrattParser.Test", "PrattParser.Test\PrattParser.Test.fsproj", "{7317F801-6AB2-4C33-B6B2-DCB006880B42}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PrattParser.Example", "PrattParser.Example\PrattParser.Example.fsproj", "{95FEFE34-6A1C-4546-8B39-77A97C7F7A82}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -18,5 +20,9 @@ Global
|
||||
{7317F801-6AB2-4C33-B6B2-DCB006880B42}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7317F801-6AB2-4C33-B6B2-DCB006880B42}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7317F801-6AB2-4C33-B6B2-DCB006880B42}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{95FEFE34-6A1C-4546-8B39-77A97C7F7A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{95FEFE34-6A1C-4546-8B39-77A97C7F7A82}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{95FEFE34-6A1C-4546-8B39-77A97C7F7A82}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{95FEFE34-6A1C-4546-8B39-77A97C7F7A82}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@@ -252,4 +252,9 @@ module Parser =
|
||||
|
||||
go lhs rest
|
||||
|
||||
let parse parser inputString tokens = parseInner parser inputString tokens 0
|
||||
let parse<'tokenTag, 'token, 'expr when 'tokenTag : comparison>
|
||||
(parser : Parser<'tokenTag, 'token, 'expr>)
|
||||
(inputString : string)
|
||||
(tokens : 'token list)
|
||||
=
|
||||
parseInner parser inputString tokens 0
|
||||
|
@@ -6,10 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Domain.fs"/>
|
||||
<Compile Include="Lexer.fs"/>
|
||||
<Compile Include="Parser.fs"/>
|
||||
<Compile Include="Example.fs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user