12.10 The swith statement
557400
function parseSwitchCase(test) {
        var consequent = [],
            statement;

        while (index < length) {
            if (match('}') || matchKeyword('default') || matchKeyword('case')) {
                break;
            }
            statement = parseStatement();
            if (typeof statement === 'undefined') {
                break;
            }
            consequent.push(statement);
        }

        return {
            type: Syntax.SwitchCase,
            test: test,
            consequent: consequent
        };
    }
597618
def p_statement_declare(p):
    ''
    p[0] = ast.Declare(p[3], p[5], lineno=p.lineno(1))
723878
def statement(self) -> Statement:
        
        pref, kw = self.keyword()
        pres = self.opt_separator()
        next = self.peek()
        if next == ";":
            arg = None
            sub = False  # type: bool
        elif next == "{":
            arg = None
            sub = True
        elif not pres:
            raise UnexpectedInput(self, "separator")
        else:
            self._arg = ""
            sub = self.argument()
            arg = self._arg
        self.offset += 1
        res = Statement(kw, arg, pref=pref)
        if sub:
            res.substatements = self.substatements()
            for sub in res.substatements:
                sub.superstmt = res
        return res
644770
function enterStatement(node) {
            const line = node.loc.start.line;

            /*
             * Skip to allow non-block statements if this is direct child of control statements.
             * `if (a) foo();` is counted as 1.
             * But `if (a) foo(); else foo();` should be counted as 2.
             */
            if (SINGLE_CHILD_ALLOWED.test(node.parent.type) &&
                node.parent.alternate !== node
            ) {
                return;
            }

            // Update state.
            if (line === lastStatementLine) {
                numberOfStatementsOnThisLine += 1;
            } else {
                reportFirstExtraStatementAndClear();
                numberOfStatementsOnThisLine = 1;
                lastStatementLine = line;
            }

            // Reports if the node violated this rule.
            if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) {
                firstExtraStatement = firstExtraStatement || node;
            }
        }
274663
private void executeAssumeStatement(Tree statement)
    {
        if (!CliMain.isConnected() || !hasKeySpace())
            return;

        String cfName = CliCompiler.getColumnFamily(statement, currentCfDefs());

        // VALIDATOR | COMPARATOR | KEYS | SUB_COMPARATOR
        String assumptionElement = statement.getChild(1).getText().toUpperCase();


        // Could be UTF8Type, IntegerType, LexicalUUIDType etc.
        String defaultType = CliUtils.unescapeSQLString(statement.getChild(2).getText());

        if (applyAssumption(cfName, assumptionElement, defaultType))
        {
            assumptions.addAssumption(keySpace, cfName, assumptionElement, defaultType);
            sessionState.out.println(String.format("Assumption for column family '%s' added successfully.", cfName));
        }
    }
633543
def on_super( statement )
      arguments = process_all(statement.children)
      SendStatement.new( nil , SuperExpression.new , arguments)
    end
1134145
def statement(self):
        
        if self.token.nature == Nature.DEF:
            node = self.function_declaration()
        elif self.token.nature == Nature.LET:
            node = self.variable_declaration()
        elif self.token.nature in (Nature.MUT, Nature.ID):
            node = self.expression_statement()
        elif self.token.nature == Nature.IF:
            node = self.if_statement()
        elif self.token.nature == Nature.WHILE:
            node = self.while_statement()
        elif self.token.nature == Nature.RETURN:
            node = self.jump_statement()
        else:
            node = self._error()

        return node
69206
def is_sw_readable(self):
        
        sw = self.get_property('sw')

        return sw in (rdltypes.AccessType.rw, rdltypes.AccessType.rw1,
                        rdltypes.AccessType.r)
1011086
def p_statement_switch(p):
    ''
    p[0] = ast.Switch(p[3], p[5], lineno=p.lineno(1))
1107406
function verify(node) {
            const parentType = node.parent.type;
            const validParent =
                astUtils.STATEMENT_LIST_PARENTS.has(parentType) ||
                parentType === "SwitchStatement";

            if (!validParent) {
                return;
            }

            // Save this node as the current previous statement.
            const prevNode = scopeInfo.prevNode;

            // Verify.
            if (prevNode) {
                const type = getPaddingType(prevNode, node);
                const paddingLines = getPaddingLineSequences(prevNode, node);

                type.verify(context, prevNode, node, paddingLines);
            }

            scopeInfo.prevNode = node;
        }
834441
public T withStatement(Statement statement) {
		PropertyIdValue pid = statement.getMainSnak()
				.getPropertyId();
		ArrayList<Statement> pidStatements = this.statements.get(pid);
		if (pidStatements == null) {
			pidStatements = new ArrayList<Statement>();
			this.statements.put(pid, pidStatements);
		}

		pidStatements.add(statement);
		return getThis();
	}
1261389
private boolean addStatement(StringBuffer statementBuffer) {
		if (statementBuffer.length() > 0) {
			elements.add(new Predicate(statementBuffer.toString()));
			elementsArray = elements.toArray();
			statementBuffer.delete(0, statementBuffer.length());
			return true;
		}
		return false;
	}
79066
def semActsSatisfied(acts: Optional[List[ShExJ.SemAct]], cntxt: Context) -> bool:
    
    return True
1002114
private void pruneStatement(final Statement stmt, final Document doc) {
        final List<StatementGroup> stmtgroups = doc.getAllStatementGroups();
        for (final StatementGroup stmtgroup : stmtgroups) {
            final Iterator<Statement> sgi = stmtgroup.getStatements()
                    .iterator();
            while (sgi.hasNext()) {
                final Statement sgs = sgi.next();
                if (stmt.equals(sgs)) {
                    // prune
                    sgi.remove();
                    return;
                }
            }
        }
    }
895083
def _notification_stmt(self, stmt: Statement, sctx: SchemaContext) -> None:
        """"""
        self._handle_child(NotificationNode(), stmt, sctx)
771390
private static int skipCommentsAndQuotes(char[] statement, int position) {
        for (int i = 0; i < START_SKIP.length; i++) {
            if (statement[position] == START_SKIP[i].charAt(0)) {
                boolean match = true;
                for (int j = 1; j < START_SKIP[i].length(); j++) {
                    if (!(statement[position + j] == START_SKIP[i].charAt(j))) {
                        match = false;
                        break;
                    }
                }
                if (match) {
                    int offset = START_SKIP[i].length();
                    for (int m = position + offset; m < statement.length; m++) {
                        if (statement[m] == STOP_SKIP[i].charAt(0)) {
                            boolean endMatch = true;
                            int endPos = m;
                            for (int n = 1; n < STOP_SKIP[i].length(); n++) {
                                if (m + n >= statement.length) {
                                    // last comment not closed properly
                                    return statement.length;
                                }
                                if (!(statement[m + n] == STOP_SKIP[i].charAt(n))) {
                                    endMatch = false;
                                    break;
                                }
                                endPos = m + n;
                            }
                            if (endMatch) {
                                // found character sequence ending comment or quote
                                return endPos + 1;
                            }
                        }
                    }
                    // character sequence ending comment or quote not found
                    return statement.length;
                }

            }
        }
        return position;
    }
1140164
function serializeStatements (statements) {
  var source = statements.map(function (st) { return st.toNT() })
  source = source.join('\n')
  return source
}