Parser rewrite
This commit is contained in:
@@ -65,10 +65,11 @@ public static partial class Extractors
|
||||
// ---------------------------------------------------------------- .NET Regex
|
||||
|
||||
/// <summary>
|
||||
/// Flat scan: matches technology blocks anywhere in the file.
|
||||
/// Fastest regex option, but it does not verify that the match really sits under <c>countries</c>.
|
||||
/// Matches a single technology block. On its own it would match anywhere in the file,
|
||||
/// so it is only used as the second stage of <see cref="RegexTwoStage" />, inside the
|
||||
/// already extracted <c>countries</c> block.
|
||||
/// </summary>
|
||||
public const string FlatPattern =
|
||||
public const string TechnologyBlockPattern =
|
||||
@"\n\t\ttechnology=\{\n\t\t\tadm_tech=(\d+)\n\t\t\tdip_tech=(\d+)\n\t\t\tmil_tech=(\d+)\n\t\t\}";
|
||||
|
||||
/// <summary>
|
||||
@@ -109,9 +110,6 @@ public static partial class Extractors
|
||||
return RegexScan(innerRegex, block.Value);
|
||||
}
|
||||
|
||||
[GeneratedRegex(FlatPattern)]
|
||||
public static partial Regex FlatSourceGen();
|
||||
|
||||
[GeneratedRegex(PathAwarePattern)]
|
||||
public static partial Regex PathAwareSourceGen();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user