diff --git a/.vscode/launch.json b/.vscode/launch.json index 67ecfca..b68dd5f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,7 +19,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build", - "program": "${workspaceFolder}/artifacts/${input:configuration}/netcoreapp3.1/Eto.Parse.TestSpeed.dll", + "program": "${workspaceFolder}/artifacts/${input:configuration}/net5.0/Eto.Parse.TestSpeed.dll", "args": [], "cwd": "${workspaceFolder}", "console": "integratedTerminal" diff --git a/Eto.Parse.TestSpeed/Eto.Parse.TestSpeed.csproj b/Eto.Parse.TestSpeed/Eto.Parse.TestSpeed.csproj index 38fa94f..5796e32 100644 --- a/Eto.Parse.TestSpeed/Eto.Parse.TestSpeed.csproj +++ b/Eto.Parse.TestSpeed/Eto.Parse.TestSpeed.csproj @@ -2,7 +2,7 @@ Exe - net48;net5.0 + net5.0;net48 false diff --git a/Eto.Parse.Tests/Eto.Parse.Tests.csproj b/Eto.Parse.Tests/Eto.Parse.Tests.csproj index 8bde97a..88637f8 100644 --- a/Eto.Parse.Tests/Eto.Parse.Tests.csproj +++ b/Eto.Parse.Tests/Eto.Parse.Tests.csproj @@ -1,7 +1,7 @@  - net48;net5.0 + net5.0;net48 false diff --git a/Eto.Parse.Tests/Samples/WidthHeightTests.cs b/Eto.Parse.Tests/Samples/WidthHeightTests.cs new file mode 100755 index 0000000..a73246b --- /dev/null +++ b/Eto.Parse.Tests/Samples/WidthHeightTests.cs @@ -0,0 +1,32 @@ +using System; +using Eto.Parse.Parsers; +using Eto.Parse.Writers; +using NUnit.Framework; + +namespace Eto.Parse.Tests.Samples +{ + [TestFixture] + public class WidthHeightTests + { + [Test] + public void TestWidthHeight() + { + var space = +Terminals.WhiteSpace; + Parser eq = "="; + + var intParser = new NumberParser { AllowDecimal = false, AllowExponent = false, ValueType = typeof(int) }; + + var width = ("width" & eq & intParser.Named("width")).Separate(); + var height = ("height" & eq & intParser.Named("height")).Separate(); + + var whhw = (width & space & height) | (height & space & width); + + var whhwGrammar = new Grammar(whhw); + Console.WriteLine(new DisplayParserWriter().Write(whhwGrammar)); + var matches = whhwGrammar.Match("width=400 height=800"); + Assert.That(matches.HasMatches); + Assert.AreEqual(400, matches["width"].Value); + Assert.AreEqual(800, matches["height"].Value); + } + } +} \ No newline at end of file diff --git a/Eto.Parse/Eto.Parse.csproj b/Eto.Parse/Eto.Parse.csproj index 6b2d9cd..2d492fe 100644 --- a/Eto.Parse/Eto.Parse.csproj +++ b/Eto.Parse/Eto.Parse.csproj @@ -14,6 +14,10 @@ Eto.Parse is a highly optimized recursive decent LL(k) parser framework that can You can use BNF, EBNF, or Gold parser grammars to define your parser, code them directly using a fluent API, or use shorthand operators (or a mix of each). +Change for v1.6: +* Fixed CharSetTerminal.CaseSensitive as it was inverted +* Add support for CharRangeTerminal.CaseSensitive + Changes for v1.5: * Add .NET Standard 2.0 target * Add .NET 4.5 target