Skip to content

Commit

Permalink
version 2.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Jan 5, 2024
1 parent e07d022 commit 40c9761
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
33 changes: 32 additions & 1 deletion src/samples/ParserExample/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using ParserTests;
using ParserTests.Issue239;
using ParserTests.Issue332;
using ParserTests.Issue414;
using ParserTests.lexer;
using simpleExpressionParser;
using SimpleTemplate;
Expand Down Expand Up @@ -1133,10 +1134,40 @@ private static void TestTemplateFor()
}

}

private static void Issue414()
{
var parserInstance = new Issue414Parser();
var builder = new ParserBuilder<Issue414Token, string>();
var buildResult = builder.BuildParser(parserInstance, ParserType.EBNF_LL_RECURSIVE_DESCENT, "block");//line-based, 1 statement per line.
var parser = buildResult.Result;
string source = "funcA(funcC(B==2));";
Stopwatch chrono = new Stopwatch();
chrono.Start();
var result = parser.Parse(source);
chrono.Stop();
Console.WriteLine($"{result.Result} : {chrono.ElapsedMilliseconds} ms");
}

private static void Issue414Expr()
{
var parserInstance = new Issue414ExpressionParser();
var builder = new ParserBuilder<Issue414Token, string>();
var buildResult = builder.BuildParser(parserInstance, ParserType.EBNF_LL_RECURSIVE_DESCENT, "block");//line-based, 1 statement per line.
var parser = buildResult.Result;
string source = "funcA(funcC(B==2));";
Stopwatch chrono = new Stopwatch();
chrono.Start();
var result = parser.Parse(source);
chrono.Stop();
Console.WriteLine($"{result.Result} : {chrono.ElapsedMilliseconds} ms");
}

private static void Main(string[] args)
{
Issue351();
Issue414();
Issue414Expr();
//Issue351();
//EscapeIt();
// TestIssue332();
//TestTemplateFor();
Expand Down
4 changes: 2 additions & 2 deletions src/sly/sly.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<Description>#LY is a parser generator halfway between parser combinators and parser generator like ANTLR</Description>
<Authors>b3b00</Authors>
<version>2.9.7.1</version>
<version>2.9.8</version>
<PackageProjectUrl>https://github.com/b3b00/sly</PackageProjectUrl>
<RepositoryUrl>https://github.com/b3b00/sly</RepositoryUrl>
<License>https://github.com/b3b00/sly/blob/master/LICENSE</License>
<PackageVersion>2.9.7.1</PackageVersion>
<PackageVersion>2.9.8</PackageVersion>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
Expand Down

0 comments on commit 40c9761

Please sign in to comment.