mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-14 08:47:57 -05:00
ZoneCodeGenerator: Fix operationType tokens not being sorted by length so shorter tokens can be matched before longer ones
This commit is contained in:
@ -44,6 +44,7 @@ namespace ZoneCodeGenerator.Parsing.CommandFile.Tests
|
||||
// operationType ::= + | - | * | / | << | >> | ...
|
||||
private static readonly TokenMatcher operationType = new MatcherGroupOr(
|
||||
OperationType.Types
|
||||
.OrderByDescending(type => type.Syntax.Length)
|
||||
.Select(type => new MatcherLiteral(type.Syntax.ToCharArray().Select(c => c.ToString()).ToArray()).WithName(TokenOperationType))
|
||||
.Cast<TokenMatcher>().ToArray()
|
||||
).WithTag(TagOperationType);
|
||||
|
Reference in New Issue
Block a user