Compare commits
2 Commits
890166ebce
...
95c0403362
| Author | SHA1 | Date | |
|---|---|---|---|
| 95c0403362 | |||
| 7353cbcd49 |
@ -75,7 +75,7 @@ internal static partial class Modes
|
|||||||
ColoredConsole.Write("Input file path: ", ConsoleColor.Blue);
|
ColoredConsole.Write("Input file path: ", ConsoleColor.Blue);
|
||||||
input = ColoredConsole.ReadLine(ConsoleColor.Gray);
|
input = ColoredConsole.ReadLine(ConsoleColor.Gray);
|
||||||
if (string.IsNullOrEmpty(input))
|
if (string.IsNullOrEmpty(input))
|
||||||
throw new NullReferenceException();
|
throw new ArgumentException("Input file path is required");
|
||||||
inputPath = input;
|
inputPath = input;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -83,9 +83,9 @@ internal static partial class Modes
|
|||||||
case "output":
|
case "output":
|
||||||
ColoredConsole.Write("Output file path [default=stdout]: ", ConsoleColor.Blue);
|
ColoredConsole.Write("Output file path [default=stdout]: ", ConsoleColor.Blue);
|
||||||
input = ColoredConsole.ReadLine(ConsoleColor.Gray);
|
input = ColoredConsole.ReadLine(ConsoleColor.Gray);
|
||||||
if (string.IsNullOrEmpty(input))
|
if(string.IsNullOrEmpty(input))
|
||||||
throw new ArgumentException("Input file path is required");
|
outputPath = null;
|
||||||
inputPath = input;
|
else outputPath = input;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "s":
|
case "s":
|
||||||
|
|||||||
@ -41,7 +41,8 @@ public static class SearchExpressionCompiler
|
|||||||
var subExprs = new List<ISearchExpression>();
|
var subExprs = new List<ISearchExpression>();
|
||||||
int supExprBegin = 1;
|
int supExprBegin = 1;
|
||||||
int bracketBalance = 1;
|
int bracketBalance = 1;
|
||||||
for (int i = supExprBegin; i < query.Length && bracketBalance != 0; i++)
|
int i = supExprBegin;
|
||||||
|
for (; i < query.Length && bracketBalance != 0; i++)
|
||||||
{
|
{
|
||||||
if (CharEqualsAndNotEscaped('(', query, i))
|
if (CharEqualsAndNotEscaped('(', query, i))
|
||||||
{
|
{
|
||||||
@ -60,7 +61,7 @@ public static class SearchExpressionCompiler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query[^1] != ')')
|
if (i != query.Length)
|
||||||
throw new NotImplementedException("Expressions after ')' are not supported");
|
throw new NotImplementedException("Expressions after ')' are not supported");
|
||||||
|
|
||||||
if (bracketBalance > 0)
|
if (bracketBalance > 0)
|
||||||
@ -68,7 +69,7 @@ public static class SearchExpressionCompiler
|
|||||||
if (bracketBalance < 0)
|
if (bracketBalance < 0)
|
||||||
throw new Exception("Too many closing brackets");
|
throw new Exception("Too many closing brackets");
|
||||||
|
|
||||||
var subPartLast = query.Slice(supExprBegin, query.Length - supExprBegin - 1);
|
var subPartLast = query.Slice(supExprBegin, i - 1 - supExprBegin);
|
||||||
var subExprLast = Compile(subPartLast);
|
var subExprLast = Compile(subPartLast);
|
||||||
subExprs.Add(subExprLast);
|
subExprs.Add(subExprLast);
|
||||||
return new MultipleMatchExpression(subExprs);
|
return new MultipleMatchExpression(subExprs);
|
||||||
|
|||||||
43
ParadoxSaveParser.WebAPI/data_filtering.txt
Normal file
43
ParadoxSaveParser.WebAPI/data_filtering.txt
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
countries
|
||||||
|
filter:
|
||||||
|
always: exists (has raw_development && raw_development != 0)
|
||||||
|
optional: is player (was_player == yes)
|
||||||
|
exclude:
|
||||||
|
flags
|
||||||
|
hidden_flags
|
||||||
|
variables
|
||||||
|
estate
|
||||||
|
active_agenda
|
||||||
|
power_projection
|
||||||
|
ai
|
||||||
|
history
|
||||||
|
navy
|
||||||
|
army
|
||||||
|
mercenary_company
|
||||||
|
active_relations
|
||||||
|
border_pct
|
||||||
|
border_sit
|
||||||
|
border_provinces
|
||||||
|
neighbours
|
||||||
|
home_neighbours
|
||||||
|
core_neighbours
|
||||||
|
inflation_history
|
||||||
|
opinion_cache
|
||||||
|
owned_provinces
|
||||||
|
controlled_provinces
|
||||||
|
core_provinces
|
||||||
|
claim_provinces
|
||||||
|
leader
|
||||||
|
query:
|
||||||
|
countries.(---.~|REB.~|PIR.~|NAT.~|*.(flags.~|hidden_flags.~|variables.~|estate.~|active_agenda.~|power_projection.~|ai.~|history.~|navy.~|army.~|mercenary_company.~|active_relations.~|border_pct.~|border_sit.~|border_provinces.~|neighbours.~|home_neighbours.~|core_neighbours.~|inflation_history.~|opinion_cache.~|owned_provinces.~|controlled_provinces.~|core_provinces.~|claim_provinces.~|leader.~|*))
|
||||||
|
|
||||||
|
active_war
|
||||||
|
filter:
|
||||||
|
optional: only player wars
|
||||||
|
previous_war
|
||||||
|
filter:
|
||||||
|
optional: only player wars
|
||||||
|
always: not fictive (has losses and lasts long)
|
||||||
|
income_statistics
|
||||||
|
nation_size_statistics
|
||||||
|
inflation_statistics
|
||||||
Loading…
Reference in New Issue
Block a user