You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The test case below explains the issue fairly well.
Unique rules work intuitively when the expansion is one level deep and the possible options are always single atoms of text.
grammar=Calyx::Grammar.newdostart"{sentence}{br}{sentence}{br}{sentence}"br"\n"sentence"I won a {$medal_type} medal!"medal_type"gold","silver","bronze"endputsgrammar.generate
But when the unique rule contains nested expressions, the evaluation result gets memorised in the lookup table, not the actual unique symbols to be picked from. For example, the grammar below gives counter-intuitive results because the evaluated result isn’t comparably unique—so either gold, silver or bronze rules can end up being repeated multiple times instead of only being selected once.
nested_grammar=Calyx::Grammar.newdostart"{sentence}{br}{sentence}{br}{sentence}"br"\n"sentence"I won a {$medal_type} medal!"medal_type"{gold}","{silver}","{bronze}"gold"gold","golden"silver"silver","silvery"bronze"bronze","bronzed"endputsnested_grammar.generate
The text was updated successfully, but these errors were encountered:
The test case below explains the issue fairly well.
Unique rules work intuitively when the expansion is one level deep and the possible options are always single atoms of text.
But when the unique rule contains nested expressions, the evaluation result gets memorised in the lookup table, not the actual unique symbols to be picked from. For example, the grammar below gives counter-intuitive results because the evaluated result isn’t comparably unique—so either gold, silver or bronze rules can end up being repeated multiple times instead of only being selected once.
The text was updated successfully, but these errors were encountered: