Skip to content

Commit

Permalink
Fix a small bug that caused dynamic dispatch to pick the wrong functi…
Browse files Browse the repository at this point in the history
…on on an empty list
  • Loading branch information
sungshik committed Nov 15, 2024
1 parent 0786737 commit 26a5702
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ list[ConversionUnit] analyze(RscGrammar rsc, str name) {
// Analyze delimiters
jobStep(jobLabel, "Analyzing delimiters");
set[Symbol] delimiters
= removeStrictPrefixes({s | /Symbol s := rsc, isDelimiter(delabel(s))})
- {s | p <- prods, /just(s) := getOuterDelimiterPair(rsc, p)}
- {s | p <- prods, /just(s) := getInnerDelimiterPair(rsc, p, getOnlyFirst = true)};
set[Symbol] delimiters = {s | /Symbol s := rsc, isDelimiter(delabel(s))};
delimiters &= removeStrictPrefixes(delimiters);
delimiters -= {s | p <- prods, /just(s) := getOuterDelimiterPair(rsc, p)};
delimiters -= {s | p <- prods, /just(s) := getInnerDelimiterPair(rsc, p, getOnlyFirst = true)};
list[Production] prodsDelimiters = [prod(lex(DELIMITERS_PRODUCTION_NAME), [\alt(delimiters)], {})];
// Analyze keywords
Expand Down Expand Up @@ -552,4 +552,4 @@ private TmRule toTmRule(RegExp begin, RegExp end, list[TmRule] patterns)
end.string,
beginCaptures = toCaptures(begin.categories),
endCaptures = toCaptures(end.categories),
patterns = patterns);
patterns = patterns);

0 comments on commit 26a5702

Please sign in to comment.