Exemplo n.º 1
0
        public static CasePattern Create(Context cx, CasePatternSwitchLabelSyntax node, Switch parent, int child)
        {
            var ret = new CasePattern(cx, node, parent, child);

            ret.TryPopulate();
            return(ret);
        }
Exemplo n.º 2
0
        public static Statement Create(Context cx, SwitchLabelSyntax node, Switch parent, int child)
        {
            switch (node.Kind())
            {
            case SyntaxKind.CaseSwitchLabel:
                return(CaseLabel.Create(cx, (CaseSwitchLabelSyntax)node, parent, child));

            case SyntaxKind.DefaultSwitchLabel:
                return(CaseDefault.Create(cx, (DefaultSwitchLabelSyntax)node, parent, child));

            case SyntaxKind.CasePatternSwitchLabel:
                return(CasePattern.Create(cx, (CasePatternSwitchLabelSyntax)node, parent, child));

            default:
                throw new InternalError(node, "Unhandled case label");
            }
        }