Skip to content

Commit 21f425d

Browse files
committed
Support usage of earlier defined variable patterns in next definitions
1 parent 9bd952b commit 21f425d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

build/build.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ function updateGrammarVariables(grammar: any) {
8585
delete grammar.variables;
8686
const variableReplacers: VariableReplacer[] = [];
8787
for (const variableName in variables) {
88-
variableReplacers.push([new RegExp(`{{${variableName}}}`, "gim"), variables[variableName]]);
88+
// Replace the pattern with earlier variables
89+
const pattern = replacePatternVariables(variables[variableName], variableReplacers);
90+
variableReplacers.push([new RegExp(`{{${variableName}}}`, "gim"), pattern]);
8991
}
9092
transformGrammarRepository(
9193
grammar,

0 commit comments

Comments
 (0)