Releases: teo-tsirpanis/Farkle
Releases · teo-tsirpanis/Farkle
Version 6.5.2
- Fixed a bug where the LALR builder would generate wrong parsing tables under certain circumstances. (#301)
Version 6.5.1
- Fixed a bug where the precompiler would not work on .NET Framework editions of MSBuild, like in Visual Studio for Windows, when targeting frameworks greater than .NET 6.
Version 6.5.0
- Added an overload of the
MarkForPrecompile
extension method that enables the precompiler to be used in AOT environments. See https://teo-tsirpanis.github.io/Farkle/the-precompiler.html#Using-the-precompiler-in-AOT-environments for more details. - Frequently used post-processors will no longer be optimized using dynamic code generation, because of concerns about the code generator's robustness. Performance might slightly regress. A more robust code generation system might be introduced in a future version of Farkle.
- More methods in the builder check their arguments for
null
and throwArgumentNullException
s. - Some documentation was fixed.
- The nullability annotations for some generic methods in the builder were fixed.
- Added
params
in the array parameter overload ofNonterminal.CreateUntyped
that takes a name and a series of production builders. - The color of the goto cells in the HTML tables was changed to a brighter shade of blue whose contrast is compliant with WCAG 2 AA.
- C# users can now define single-member productions by directly calling
Finish(Constant)
without callingAppended()
orExtending()
. Previously only some combinations were supported (Finish
on typed designtime Farkles andFinishConstant
on literals), but now all can be used. - The HTML DFA States tables were restyled to make them consistent with the LALR States tables. In particular the columns were swapped and the dark grey background of the character cells was removed.
- The
farkle new
command will place the output in the current directory instead of the input grammar's or assembly's directory, if not given an output path by the user. - The
Production<T>
type became a covariant interface, fixing issue #26. Because it used to be a sealed class with no members, it is not expected to be a breaking change. User code is not allowed to implement it. - Trimming warnings were reduced. A couple of them remain and might appear when building grammars without the precompiler, but they pose no risk, removing them was non-trivial.
Version 6.4.0
- Breaking change:
Farkle.Tools.MSBuild
require MSBuild 17, which comes with Visual Studio 2022 and the .NET 6 SDK. - Farkle supports precompiling .NET 6 assemblies from Visual Studio.
- Fixed random compiler errors when using the F# production builder operators
.>>
and.>>.
. - The precompiler supports writing both a conflict report and detailed MSBuild errors via the
FarklePrecompilerErrorMode
property. Its allowed values areReportOnly
(default),ErrorsOnly
andBoth
. - String regexes support specifying predefined sets by their property name as well. For example, until now you could match all characters in the
Greek Extended
character set by specifying\p{Greek Extended}
. From now on,\p{GreekExtended}
will work too. - Various bug fixes, particularly in the precompiler.
Version 6.3.2
- Fixed a bug where the precompiler would not work on .NET Framework editions of MSBuild, like in Visual Studio for Windows.
Version 6.3.1
- Minor breaking change:
Farkle.Builder.RegexGrammar.designtime
's type became a regularDesigntimeFarkle<Regex>
, after being changed to aNonterminal<Regex>
in Farkle 6.3.0 by mistake. This change is unlikely to affect any regular user of Farkle. - Fixed a bug where Farkle's assembly was not shrunk enough when trimmed.
Version 6.3.0
- Minor breaking change: Text with legacy CR line endings is no longer supported. Since this version, they will no longer be recognized as line endings by position tracking. When Farkle's next major version gets released, they will cause lexical errors.
- Minor breaking change: The
Farkle.Builder.GrammarMetadata
type has an additional field of typeFarkle.Builder.OperatorPrecedence.OperatorScope
. User code that does not directly set metadata to designtime Farkles is not affected. - The precompiler will now generate an HTML report if a grammar has LALR conflicts.
- The precompiler now works on Visual Studio for Windows. In this case only, it requires to install the .NET tool
Farkle.Tools
. - When building a grammar, if Farkle cannot distinguish between two symbols, it will now include an example word that made it indecisive in the error message. A new build error type named
IndistinguishableSymbols2
was introduced. - Any type of designtime Farkle can now be renamed or set metadata like case sensitivity, comments or operator scopes, without using the
DesigntimeFarkle.cast
function. There were some binary breaking changes but none is source breaking. - Operator scopes will now correctly recognize multiple representations of the same designtime Farkle, such as an original terminal and a renamed one, or a string, and a designtime Farkle created with the
literal
operator that got passed the same string. - Fixed a bug on the
new
CLI tool command where the--prop
option could not be specified more than once. - Fixed a bug where the
new
CLI tool command could not be used on projects or assemblies. - Fixed a bug where titlecase letters were not excluded when building case-insensitive grammars.
- Fixed a bug where the
sepBy
operator could not match exactly one item.
Version 6.2.0
- Breaking change: The
Farkle.Builder.LALRBuildTypes
module, as well as most functions of theFarkle.Builder.LALRBuild
module became internal. - Minor breaking change: Whitespace inside the "between", "at least" and "exactly
n
times" regex string quantifiers is no longer allowed. Using string regexes like\d{ 4}
will cause an error. - Minor breaking change: The
Farkle.Builder.IRawDelegateProvider
interface and a function in theFarkle.Builder.DFABuild
module became private. They were public by accident and served no purpose for Farkle's users. - Minor breaking change: Users that write their own tokenizers must ensure that CRLF line endings are
Advance
d at once, otherwise the character stream's position will be incorrect. The vast majority of use cases (those that doesn't involve custom tokenizers) will not be affected by this change. - Minor breaking change: Terminals, literals, and groups that are case-insensitively named
NewLine
will have an underscore prepended to their name when built, making them_NewLine
for example. This change is a temporary workaround for a design deficiency of Farkle, where these terminals could end line groups and comments. It will be thoroughly fixed in the next major version. Because these names are only used for diagnostics and documentation generation, parser behavior will not be affected by this change. Nor will grammars read by EGT files be changed. - Minor breaking change: The
\s
and\S
string regex symbol will now match exactly either horizontal tabs, line feeds, carriage returns or spaces. Other characters like vertical tabs and non-breaking spaces are no longer matched. This change matches Farkle's definition of whitespace. To revert to the previous behavior use\p{Whitespace}
or\P{Whitespace}
. - Farkle's string regexes got many improvements and bug fixes, bringing their syntax closer -but not a 100% match- to popular regex languages. Take a look at the string regex reference for more details.
- The precompiler now works when used on a project targeting a framework earlier than .NET Core 3.1.
- The
Position.Advance
method got a new overload that accepts aReadOnlySpan
of characters. It is recommended over the existing one that accepts a single character because it reliably handles line endings. - Building a grammar can now be cancelled by new functions introduced in
Farkle.Builder
'sDFABuild
,LALRBuild
andDesigntimeFarkleBuild
modules. Additionally theBuild
andBuildUntyped
extension methods of designtime Farkles now accept an optional cancellation token. - Fixed a bug where the wrong error position was sometimes reported on text with LF line endings.
- Fixed a bug where the wrong error position was reported on syntax errors.
Version 6.1.0
- Some typos were fixed in Farkle's HTML templates.
- The
ParserApplicationExceptionWithPosition
type was deprecated in favor of a new constructor inParserApplicationException
. - The EGT file reader will throw an exception if it tries to load a grammar file that shifts on EOF in one of its LALR states (which would cause infinite loops).
- The designtime Farkles that are returned by the
many
andmany1
operators now have the correct name. - Throwing a
ParserException
during post-processing will not be thrown in user code inside aPostProcessorException
, but will be caught by the runtime Farkle API, allowing to customize the parser error message in greater detail.
Version 6.0.0
- Breaking change: The functions
RuntimeFarkle.ofEGTFile
andRuntimeFarkle.ofBase64String
as well as their correspondingRuntimeFarkle
static methods were removed. Users are advised to migrate away from GOLD Parser. - Breaking change: The
RuntimeFarkle.GetBuildError
method was replaced byGetBuildErrors
, which returns a list of build errors. - Breaking change: The
Farkle.Grammar.Grammar.Properties
member now holds a strongly-typed record of informative grammar properties. Unrecognized GOLD Parser properties such as "Author", "Description" and "Version" are discarded. Existing grammar files remain compatible. - Breaking change: The members of Farkle's discriminated unions can no longer be accessed in F# using a method. For example,
let foo (x: Terminal) = printfn "%s" x.Name
becomeslet foo (Terminal(_, name)) = printfn "%s" name
. For C# users, duplicate properties likeTerminal.name
with a lowercase "n" were removed; they are replaced by their corresponding title-cased properties. - Breaking change: The members of many of Farkle's discriminated unions got meaningful names. C# code using the older names might break.
- Breaking change: Removed support for generating legacy grammar skeleton files from MSBuild using the
Farkle
item. - Breaking change: The
Farkle.Common.SetOnce
type became internal. - Farkle's types and methods support C# 8.0's Nullable Reference Types.
- Farkle's builder supports defining operator precedence and associativity to resolve conflicts. The quick start guide was updated.
- Farkle supports virtual terminals -terminals that are not backed by the default tokenizer's DFA but created by custom tokenizers-, allowing for scenarios like indent-based grammars. An F# sample of an indent-based grammar was published.
- Dynamic code generation will be applied to post-processors that are frequently used, in a fashion similar to .NET's tiered compilation, regardless of whether their designtime Farkle is precompilable.
- Build error reporting is improved. More build errors will be reported at the same time, without having to fix one to show the next.
- Stack overflows when building extremely complex designtime Farkles were either mitigated or will throw recoverable exceptions.