From 5f40adb70cffbdd68667826cf5e620e4ffe0ad7b Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 8 Aug 2017 17:20:04 -0700 Subject: [PATCH] Recur to sub-rules in a deterministic order in expand_repeats --- src/compiler/prepare_grammar/expand_repeats.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/compiler/prepare_grammar/expand_repeats.cc b/src/compiler/prepare_grammar/expand_repeats.cc index c4a25634..9f663d67 100644 --- a/src/compiler/prepare_grammar/expand_repeats.cc +++ b/src/compiler/prepare_grammar/expand_repeats.cc @@ -36,10 +36,9 @@ class ExpandRepeats { }, [&](const rules::Seq &sequence) { - return rules::Seq{ - apply(*sequence.left), - apply(*sequence.right) - }; + auto left = apply(*sequence.left); + auto right = apply(*sequence.right); + return rules::Seq{left, right}; }, [&](const rules::Repeat &repeat) {