public JNode VisitCaseLabel(CaseLabel node) { var node2 = new JSwitchLabel { IsDefault = node.Expression.IsNull, //the alternative doesn't work: node.Role == CaseLabel.DefaultKeywordRole, Expression = VisitExpression(node.Expression), }; return(node2); }
public void VisitSwitchLabel(JSwitchLabel node) { if (node.IsDefault) { Write("default"); } else { Write("case"); Visit(node.Expression); } Write(":"); WriteLine(); }