Skip to content

Commit d1df48e

Browse files
committed
CustomVariableSubstitution
1 parent 6e1ebb8 commit d1df48e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/src/dart/_icu_parser.dart

+8-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class CustomIcuParser {
6767
Parser get empty => epsilon().map((_) => '');
6868

6969
Parser get parameter => (openCurly & id & closeCurly)
70-
.map((param) => VariableSubstitution.named(param[1], null));
70+
.map((param) => CustomVariableSubstitution.named(param[1], null));
7171

7272
/// The primary entry point for parsing. Accepts a string and produces
7373
/// a parsed representation of it as a Message.
@@ -88,3 +88,10 @@ class CustomIcuParser {
8888
interiorText.set(contents.plus() | empty);
8989
}
9090
}
91+
92+
class CustomVariableSubstitution extends VariableSubstitution {
93+
final String variable;
94+
CustomVariableSubstitution.named(String name, Message parent)
95+
: variable = name,
96+
super.named(name, parent);
97+
}

0 commit comments

Comments
 (0)