case_list : empty
                 | case_list CASE expr case_separator inner_statement_list
                 | case_list DEFAULT case_separator inner_statement_list
13810
def p_case_list(p):
    ''''''
    if len(p) == 6:
        p[0] = p[1] + [ast.Case(p[3], p[5], lineno=p.lineno(2))]
    elif len(p) == 5:
        p[0] = p[1] + [ast.Default(p[4], lineno=p.lineno(2))]
    else:
        p[0] = []
152887
def p_casecontent_statement(self, p):
        ''
        p[0] = Case(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1185764
def p_case_list(self, p):
        ''''''
        if len(p) == 4:
            p[1].append(p[3])
            p[0] = p[1]
        elif len(p) == 2:
            p[0] = [p[1]]
1173468
def case(self, case):
        
        LOG.debug("Getting case {0} from database".format(case.get('case_id')))
        case_id = case['case_id']
        return self.db.case.find_one({'case_id': case_id})
19919
def p_case_list(p):
    
    if len(p) == 1:
        p[0] = node.stmt_list()
    elif len(p) == 3:
        assert isinstance(p[2], node.stmt_list)
        p[0] = p[2]
    elif len(p) == 6:
        p[0] = node.if_stmt(
            cond_expr=node.expr(
                op="==", args=node.expr_list([p[2]])),
            then_stmt=p[4],
            else_stmt=p[5])
        p[0].cond_expr.args.append(
            None)  # None will be replaced using backpatch()
    else:
        assert 0
1309403
def p_lconst_case_list(self, p):
        ''''''
        if len(p) == 4:
            p[0] = [('lconst', (p[1], p[3]))]
        elif len(p) == 6:
            p[1].append(('lconst', (p[3], p[5])))
            p[0] = p[1]
208313
public static int listFindNoCase(String list, String value, String delimiter) {
	return listFindNoCase(list, value, delimiter, true);
    }
934324
def text(self):
        
        text = []
        rows = self.rowCount()
        cols = self.columnCount()

        # handle empty table case
        if rows == 2 and cols == 2:
            item = self.item(0, 0)
            if item is None:
                return ''

        for r in range(rows - 1):
            for c in range(cols - 1):
                item = self.item(r, c)
                if item is not None:
                    value = item.text()
                else:
                    value = '0'

                if not value.strip():
                    value = '0'

                text.append(' ')
                text.append(value)
            text.append(ROW_SEPARATOR)

        return ''.join(text[:-1])
1061901
function dsStatement(statement) {
  switch(statement.constructor) {
    case Statements.Blank:
    case Statements.Conditional:
    case Statements.DialogueSegment:
    case Statements.Evaluate:
    case Statements.Function:
    case Statements.Link:
    case Statements.Option:
    case Statements.OptionGroup:
    case Statements.Shortcut:
    case Statements.ShortcutGroup:
      return false;
    case Statements.Command:
    case Statements.LineGroup:
    case Statements.Text:
    case Statements.Hashtag:
      return true;
    default: 
      console.warn(`Unrecognized statement type: ${statement.constructor.name}`);
      return false;
  }
}
709278
def _handle_special_yaml_cases(v):
    
    if "::" in v:
        out = {}
        for part in v.split("::"):
            k_part, v_part = part.split(":")
            out[k_part] = v_part.split(";")
        v = out
    elif ";" in v:
        # split lists and remove accidental empty values
        v = [x for x in v.split(";") if x != ""]
    elif isinstance(v, list):
        v = v
    else:
        try:
            v = int(v)
        except ValueError:
            if v.lower() == "true":
                v = True
            elif v.lower() == "false":
                    v = False
    return v
593263
@Override
  protected ITerminalStatement getLeastSignificantTerminalStatement_internal( boolean[] bAbsolute )
  {
    ITerminalStatement termRet = null;
    bAbsolute[0] = true;
    boolean bBreak = false;
    ITerminalStatement lastCaseTerm = null;
    if( _cases != null )
    {
      for( int i = 0; i < _cases.length; i++ )
      {
        List caseStatements = _cases[i].getStatements();
        if( caseStatements != null && caseStatements.size() > 0 )
        {
          boolean bCaseAbs = true;
          for( int iStmt = 0; iStmt < caseStatements.size(); iStmt++ )
          {
            boolean[] bCsr = {false};
            ITerminalStatement terminalStmt = ((Statement)caseStatements.get( iStmt )).getLeastSignificantTerminalStatement( bCsr );
            if( terminalStmt != null )
            {
              bCaseAbs = bCsr[0];
              if( !(terminalStmt instanceof IBreakStatement) ) {
                termRet = getLeastSignificant( termRet, terminalStmt );
                if( i == _cases.length-1 ) {
                  lastCaseTerm = termRet;
                }
              }
              else {
                bAbsolute[0] = bCaseAbs = false;
                bBreak = true;
              }
              //## todo: this can be true iff the switch-expr type is an enum and all the constants are covered in the cases and they all have the same absolute non-break terminal (not an unusual use-case)
            }
          }
          bAbsolute[0] = bAbsolute[0] && bCaseAbs;
        }
      }
    }
    boolean bDefaultContributed = false;
    if( _defaultStatements != null ) {
      if( _defaultStatements.size() > 0 ) {
        if( !bBreak ) {
          // If none of the cases have a break, the cases all either fall through to the default clause
          // or never flow to the next stmt following this switch.  Therefore, the default clause's terminal,
          // if one is present, establishes the switch's terminal.
          bAbsolute[0] = true;
        }
        boolean bDefaultAbs = false;
        for( int i = 0; i < _defaultStatements.size(); i++ )
        {
          boolean[] bCsr = {false};
          ITerminalStatement terminalStmt = _defaultStatements.get( i ).getLeastSignificantTerminalStatement( bCsr );
          if( terminalStmt != null ) {
            if( !(terminalStmt instanceof IBreakStatement) ) {
              bDefaultAbs = bCsr[0];
              termRet = getLeastSignificant( termRet, terminalStmt );
              bDefaultContributed = true;
            }
          }
        }
        bAbsolute[0] = bAbsolute[0] && bDefaultAbs;
      }
    }
    else if( !bBreak && lastCaseTerm != null && isCoveredEnumSwitch() ) {
      // Switch is a covered Enum where all cases are non-breaking terminators
      // (Note the compiler generate what is effectively a default clause that throws an exception for the 'null' case or if the Enum changes where new values are added)
      // (Note also, the compiler generates an implicit break statement in the last case-clause if it does not terminate explicitly)
      termRet = getLeastSignificant( new ThrowStatement(), lastCaseTerm );
      bAbsolute[0] = bDefaultContributed = true;
    }
    bAbsolute[0] = bAbsolute[0] && termRet != null && bDefaultContributed;
    return termRet;
  }
42345
private boolean isUselessCase(
      Node caseNode, @Nullable Node previousCase, @Nullable Node defaultCase) {
    checkState(previousCase == null || previousCase.getNext() == caseNode);
    // A case isn't useless if a previous case falls through to it unless it happens to be the last
    // case in the switch.
    Node switchNode = caseNode.getParent();
    if (switchNode.getLastChild() != caseNode && previousCase != null) {
      Node previousBlock = previousCase.getLastChild();
      if (!previousBlock.hasChildren()
          || !isExit(previousBlock.getLastChild())) {
        return false;
      }
    }

    Node executingCase = caseNode;
    while (executingCase != null) {
      checkState(executingCase.isDefaultCase() || executingCase.isCase());
      // We only expect a DEFAULT case if the case we are checking is the
      // DEFAULT case.  Otherwise, we assume the DEFAULT case has already
      // been removed.
      checkState(caseNode == executingCase || !executingCase.isDefaultCase());
      if (!executingCase.isDefaultCase() && mayHaveSideEffects(executingCase.getFirstChild())) {
        // The case falls thru to a case whose condition has a potential side-effect,
        // removing the candidate case would skip that side-effect, so don't.
        return false;
      }
      Node block = executingCase.getLastChild();
      checkState(block.isBlock());
      if (block.hasChildren()) {
        for (Node blockChild : block.children()) {
          // If this is a block with a labelless break, it is useless.
          switch (blockChild.getToken()) {
            case BREAK:
              // A case with a single labelless break is useless if it is the default case or if
              // there is no default case. A break to a different control structure isn't useless.
              return !blockChild.hasChildren()
                  && (defaultCase == null || defaultCase == executingCase);
            case VAR:
              if (blockChild.hasOneChild()
                  && blockChild.getFirstFirstChild() == null) {
                // Variable declarations without initializations are OK.
                continue;
              }
              return false;
            default:
              return false;
          }
        }
      }
      // Look at the fallthrough case
      executingCase = executingCase.getNext();
    }
    return true;
  }
964818
def p_switch_statement(self, p):
        """"""
        cases = []
        default = None
        # iterate over return values from case_block
        for item in p[5]:
            if isinstance(item, ast.Default):
                default = item
            elif isinstance(item, list):
                cases.extend(item)

        p[0] = ast.Switch(expr=p[3], cases=cases, default=default)
159757
def _process_exlist(self, exc, raised):
        """"""
        if (not raised) or (raised and exc.endswith("*")):
            return exc[:-1] if exc.endswith("*") else exc
        return None
237381
def _parse_list(cls, value, separator=','):
        
        if isinstance(value, list):  # _get_parser_compound case
            return value

        if '\n' in value:
            value = value.splitlines()
        else:
            value = value.split(separator)

        return [chunk.strip() for chunk in value if chunk.strip()]
365962
def get_statements_noprior(self):
        
        stmt_lists = [v for k, v in self.stmts.items() if k != 'prior']
        stmts = []
        for s in stmt_lists:
            stmts += s
        return stmts
1146511
def bracketedList(l, r, sep, expr, allow_missing_close=False):
  
  # We may need to backtrack for lists, because of list comprehension, but not for
  # any of the other lists
  strict = l != '['
  closer = sym(r) if not allow_missing_close else p.Optional(sym(r))
  if strict:
    return sym(l) - listMembers(sep, expr) - closer
  else:
    return sym(l) + listMembers(sep, expr) + closer