src/parser.js
function parseSwitchType(lex) {
    var start = lex.accept('switchtype');
    if (!start) {
        return null;
    }

    var expr = parseExpression(lex);
    lex.assert('{');

    var cases = [];
    var end;
    do {
        let c = parseSwitchTypeCase(lex);
        cases.push(c);
    } while (!(end = lex.accept('}')));

    return new nodes.SwitchTypeNode(expr, cases, start.start, end.end);
}
function parseSwitchType(lex) {
    var start = lex.accept('switchtype');
    if (!start) {
        return null;
    }

    var expr = parseExpression(lex);
    lex.assert('{');

    var cases = [];
    var end;
    do {
        let c = parseSwitchTypeCase(lex);
        cases.push(c);
    } while (!(end = lex.accept('}')));

    return new nodes.SwitchTypeNode(expr, cases, start.start, end.end);
}
function parseSwitchType ( lex ) { var start = lex . accept ( 'switchtype' ) ; if ( ! start ) { return null ; } var expr = parseExpression ( lex ) ; lex . assert ( '{' ) ; var cases = [ ] ; var end ; do { let c = parseSwitchTypeCase ( lex ) ; cases . push ( c ) ; } while ( ! ( end = lex . accept ( '}' ) ) ) ; return new nodes . SwitchTypeNode ( expr , cases , start . start , end . end ) ; }
Parses a `switchtype` statement
@param  {Lexer} lex
@return {SwitchType}
Parses a switchtype statement