Skip to content

Commit 3b2c2d0

Browse files
authored
Merge pull request #46 from jeffijoe/fix/url
Fix extension parsing
2 parents 13ce061 + 0500f57 commit 3b2c2d0

File tree

86 files changed

+5547
-5688
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+5547
-5688
lines changed

src/.idea/.idea.MessageFormat/.idea/projectSettingsUpdater.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
using System.Collections.Generic;
22
using System.Diagnostics;
33

4-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
4+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
5+
6+
[DebuggerDisplay("{{RuleDescription}}")]
7+
public class Condition
58
{
6-
[DebuggerDisplay("{{RuleDescription}}")]
7-
public class Condition
9+
public Condition(string count, string ruleDescription, IReadOnlyList<OrCondition> orConditions)
810
{
9-
public Condition(string count, string ruleDescription, IReadOnlyList<OrCondition> orConditions)
10-
{
11-
Count = count;
12-
RuleDescription = ruleDescription;
13-
OrConditions = orConditions;
14-
}
11+
Count = count;
12+
RuleDescription = ruleDescription;
13+
OrConditions = orConditions;
14+
}
1515

16-
public string Count { get; }
16+
public string Count { get; }
1717

18-
public string RuleDescription { get; }
18+
public string RuleDescription { get; }
1919

20-
public IReadOnlyList<OrCondition> OrConditions { get; }
21-
}
22-
}
20+
public IReadOnlyList<OrCondition> OrConditions { get; }
21+
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public interface ILeftOperand
24
{
3-
public interface ILeftOperand
4-
{
5-
}
65
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public interface IRightOperand
24
{
3-
public interface IRightOperand
4-
{
5-
}
65
}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public class ModuloOperand : ILeftOperand
24
{
3-
public class ModuloOperand : ILeftOperand
5+
public ModuloOperand(OperandSymbol operandSymbol, int modValue)
46
{
5-
public ModuloOperand(OperandSymbol operandSymbol, int modValue)
6-
{
7-
Operand = operandSymbol;
8-
ModValue = modValue;
9-
}
7+
Operand = operandSymbol;
8+
ModValue = modValue;
9+
}
1010

11-
public OperandSymbol Operand { get; }
12-
public int ModValue { get; }
11+
public OperandSymbol Operand { get; }
12+
public int ModValue { get; }
1313

14-
public override bool Equals(object? obj)
15-
{
16-
if (obj is ModuloOperand op)
17-
return op.Operand == Operand && op.ModValue == ModValue;
14+
public override bool Equals(object? obj)
15+
{
16+
if (obj is ModuloOperand op)
17+
return op.Operand == Operand && op.ModValue == ModValue;
1818

19-
return this == obj;
20-
}
19+
return this == obj;
20+
}
2121

22-
public override int GetHashCode()
23-
{
24-
return Operand.GetHashCode() + ModValue.GetHashCode();
25-
}
22+
public override int GetHashCode()
23+
{
24+
return Operand.GetHashCode() + ModValue.GetHashCode();
2625
}
27-
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public class NumberOperand : IRightOperand
24
{
3-
public class NumberOperand : IRightOperand
5+
public NumberOperand(int number)
46
{
5-
public NumberOperand(int number)
6-
{
7-
Number = number;
8-
}
7+
Number = number;
8+
}
99

10-
public int Number { get; }
10+
public int Number { get; }
1111

12-
public override bool Equals(object? obj)
13-
{
14-
if (obj is NumberOperand n)
15-
return n.Number == Number;
12+
public override bool Equals(object? obj)
13+
{
14+
if (obj is NumberOperand n)
15+
return n.Number == Number;
1616

17-
return this == obj;
18-
}
17+
return this == obj;
18+
}
1919

20-
public override int GetHashCode()
21-
{
22-
return Number.GetHashCode();
23-
}
20+
public override int GetHashCode()
21+
{
22+
return Number.GetHashCode();
2423
}
2524
}
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public enum OperandSymbol
24
{
3-
public enum OperandSymbol
4-
{
5-
/// <summary>
6-
/// n - absolute value of the source number.
7-
/// </summary>
8-
AbsoluteValue,
9-
10-
/// <summary>
11-
/// i - integer digits of n.
12-
/// </summary>
13-
IntegerDigits,
14-
15-
/// <summary>
16-
/// v - number of visible fraction digits in n, with trailing zeros.
17-
/// </summary>
18-
VisibleFractionDigitNumber,
19-
20-
/// <summary>
21-
/// w - number of visible fraction digits in n, without trailing zeros.
22-
/// </summary>
23-
VisibleFractionDigitNumberWithoutTrailingZeroes,
24-
25-
/// <summary>
26-
/// f - number of visible fraction digits in n, with trailing zeros.
27-
/// </summary>
28-
VisibleFractionDigits,
29-
30-
/// <summary>
31-
/// t - visible fraction digits in n, without trailing zeros.
32-
/// </summary>
33-
VisibleFractionDigitsWithoutTrailingZeroes,
34-
35-
/// <summary>
36-
/// c - compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
37-
/// </summary>
38-
ExponentC,
39-
40-
/// <summary>
41-
/// e - currently, synonym for ‘c’. however, may be redefined in the future.
42-
/// </summary>
43-
ExponentE,
44-
}
45-
}
5+
/// <summary>
6+
/// n - absolute value of the source number.
7+
/// </summary>
8+
AbsoluteValue,
9+
10+
/// <summary>
11+
/// i - integer digits of n.
12+
/// </summary>
13+
IntegerDigits,
14+
15+
/// <summary>
16+
/// v - number of visible fraction digits in n, with trailing zeros.
17+
/// </summary>
18+
VisibleFractionDigitNumber,
19+
20+
/// <summary>
21+
/// w - number of visible fraction digits in n, without trailing zeros.
22+
/// </summary>
23+
VisibleFractionDigitNumberWithoutTrailingZeroes,
24+
25+
/// <summary>
26+
/// f - number of visible fraction digits in n, with trailing zeros.
27+
/// </summary>
28+
VisibleFractionDigits,
29+
30+
/// <summary>
31+
/// t - visible fraction digits in n, without trailing zeros.
32+
/// </summary>
33+
VisibleFractionDigitsWithoutTrailingZeroes,
34+
35+
/// <summary>
36+
/// c - compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
37+
/// </summary>
38+
ExponentC,
39+
40+
/// <summary>
41+
/// e - currently, synonym for ‘c’. however, may be redefined in the future.
42+
/// </summary>
43+
ExponentE,
44+
}
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
using System.Collections.Generic;
22

3-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
3+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
4+
5+
public class Operation
46
{
5-
public class Operation
7+
public Operation(ILeftOperand operandLeft, Relation relation, IReadOnlyList<IRightOperand> operandRight)
68
{
7-
public Operation(ILeftOperand operandLeft, Relation relation, IReadOnlyList<IRightOperand> operandRight)
8-
{
9-
OperandLeft = operandLeft;
10-
Relation = relation;
11-
OperandRight = operandRight;
12-
}
9+
OperandLeft = operandLeft;
10+
Relation = relation;
11+
OperandRight = operandRight;
12+
}
1313

14-
public ILeftOperand OperandLeft { get; }
14+
public ILeftOperand OperandLeft { get; }
1515

16-
public Relation Relation { get; }
16+
public Relation Relation { get; }
1717

18-
public IReadOnlyList<IRightOperand> OperandRight { get; }
19-
}
20-
}
18+
public IReadOnlyList<IRightOperand> OperandRight { get; }
19+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using System.Collections.Generic;
22

3-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
3+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
4+
5+
public class OrCondition
46
{
5-
public class OrCondition
7+
public OrCondition(IReadOnlyList<Operation> andConditions)
68
{
7-
public OrCondition(IReadOnlyList<Operation> andConditions)
8-
{
9-
AndConditions = andConditions;
10-
}
11-
12-
public IReadOnlyList<Operation> AndConditions { get; }
9+
AndConditions = andConditions;
1310
}
14-
}
11+
12+
public IReadOnlyList<Operation> AndConditions { get; }
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
using System.Collections.Generic;
22

3-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
3+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
4+
5+
public class PluralRule
46
{
5-
public class PluralRule
7+
public PluralRule(string[] locales, IReadOnlyList<Condition> conditions)
68
{
7-
public PluralRule(string[] locales, IReadOnlyList<Condition> conditions)
8-
{
9-
Locales = locales;
10-
Conditions = conditions;
11-
}
9+
Locales = locales;
10+
Conditions = conditions;
11+
}
1212

13-
public string[] Locales { get; }
13+
public string[] Locales { get; }
1414

15-
public IReadOnlyList<Condition> Conditions { get; }
16-
}
17-
}
15+
public IReadOnlyList<Condition> Conditions { get; }
16+
}
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public class RangeOperand : IRightOperand
24
{
3-
public class RangeOperand : IRightOperand
5+
public RangeOperand(int start, int end)
46
{
5-
public RangeOperand(int start, int end)
6-
{
7-
Start = start;
8-
End = end;
9-
}
7+
Start = start;
8+
End = end;
9+
}
1010

11-
public int Start { get; }
12-
public int End { get; }
11+
public int Start { get; }
12+
public int End { get; }
1313

14-
public override bool Equals(object? obj)
15-
{
16-
if (obj is RangeOperand n)
17-
return n.Start == Start && n.End == End;
14+
public override bool Equals(object? obj)
15+
{
16+
if (obj is RangeOperand n)
17+
return n.Start == Start && n.End == End;
1818

19-
return this == obj;
20-
}
19+
return this == obj;
20+
}
2121

22-
public override int GetHashCode()
23-
{
24-
return Start.GetHashCode() + End.GetHashCode();
25-
}
22+
public override int GetHashCode()
23+
{
24+
return Start.GetHashCode() + End.GetHashCode();
2625
}
27-
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST
1+
namespace Jeffijoe.MessageFormat.MetadataGenerator.Plural.Parsing.AST;
2+
3+
public enum Relation
24
{
3-
public enum Relation
4-
{
5-
Equals, NotEquals
6-
}
7-
}
5+
Equals, NotEquals
6+
}

0 commit comments

Comments
 (0)