File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -882,13 +882,12 @@ export class Compiler {
882882 return visit ( ir . substituteParams ( ruleInfo . body , children ) ) ;
883883 }
884884
885- if ( children . length > 0 ) {
885+ const specializedName = ir . specializedName ( irExp ) ;
886+ if ( specializedName !== ruleName ) {
886887 // Record this pattern.
887888 const rulePatterns = setdefault ( patternsByRule , ruleName , ( ) => new Map ( ) ) ;
888- rulePatterns . set ( ir . specializedName ( irExp ) , children ) ;
889+ rulePatterns . set ( specializedName , children ) ;
889890 }
890-
891- const specializedName = ir . specializedName ( irExp ) ;
892891 this . _ensureRuleId ( specializedName ) ;
893892
894893 // If not yet seen, recursively visit the body of the specialized
@@ -1176,7 +1175,7 @@ export class Compiler {
11761175 case 'Param' :
11771176 // Fall through (Params should not exist at codegen time).
11781177 default :
1179- throw new Error ( `not handled: ${ exp . ruleName } ` ) ;
1178+ throw new Error ( `not handled: ${ exp . type } ` ) ;
11801179 }
11811180 } ) ;
11821181 asm . popStackFrame ( ) ;
You can’t perform that action at this time.
0 commit comments