Skip to content

Commit

Permalink
Add "unknown type" case to inlined switch
Browse files Browse the repository at this point in the history
svn path=/spoofax/branches/jsglr-layout-merge/; revision=25918
  • Loading branch information
maartje committed Feb 9, 2013
1 parent dc32194 commit 4e35345
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -348,8 +348,10 @@ public Object buildTreeAmb(ParseNode a) {
return buildTreeProduction((ParseProductionNode) n);
case AbstractParseNode.AMBIGUITY :
return buildTreeAmb((ParseNode) n);
default :
case AbstractParseNode.PARSENODE :
return buildTreeNode((ParseNode) n);
default:
throw new IllegalStateException("Unkown node type");
}
}

Expand All @@ -369,6 +371,7 @@ public Object buildTreeAmb(ParseNode a) {
inLexicalContext = oldLexicalContext;

Object subtree;

switch (subnode.getNodeType()) {
case AbstractParseNode.CYCLE :
subtree = buildTreeCycle((CycleParseNode) subnode);
Expand All @@ -379,8 +382,11 @@ public Object buildTreeAmb(ParseNode a) {
case AbstractParseNode.AMBIGUITY :
subtree = buildTreeAmb((ParseNode) subnode);
break;
default :
subtree = buildTreeNode((ParseNode) subnode);
case AbstractParseNode.PARSENODE :
subtree = buildTreeNode((ParseNode) subnode);
break;
default:
throw new IllegalStateException("Unkown node type");
}
Object child = tryBuildAutoConcatListNode(subtree);

Expand Down

0 comments on commit 4e35345

Please sign in to comment.