Block Name must match Block Name in paired End Object Statement
        if Block Name is present in End Object Statement StatementDelim.

        BeginObjectStmt ::=
            BeginObjectKeywd WSC AssignmentSymbol WSC BlockName StatementDelim
169913
def parse_object(self, stream):
        
        self.expect_in(stream, self.begin_object_tokens)

        self.ensure_assignment(stream)
        name = self.next_token(stream)

        self.skip_statement_delimiter(stream)
        statements = self.parse_block(stream, self.has_end_object)

        self.expect_in(stream, self.end_object_tokens)
        self.parse_end_assignment(stream, name)
        self.skip_statement_delimiter(stream)

        return name.decode('utf-8'), PVLObject(statements)
732841
protected static final int findSameIndexBlock(int index[], int indexLength,
                                                  int otherBlock) 
    {
        for (int block = BMP_INDEX_LENGTH_; block < indexLength; 
             block += SURROGATE_BLOCK_COUNT_) {
            if(equal_int(index, block, otherBlock, SURROGATE_BLOCK_COUNT_)) {
                return block;
            }
        }
        return indexLength;
    }
830777
function checkKeyframesBlocks(i) {
  if (i >= tokensLength) return 0;

  const blockEnd = tokens[i].block_end;
  const start = i;
  let l;

  if (!blockEnd) return 0;

  if (l = checkSC(i)) i += l;

  if (l = checkKeyframesBlock(i)) i += l;

  while (i < blockEnd) {
    if (l = checkSC(i)) i += l;
    else if (l = checkKeyframesBlock(i)) i += l;
    else if (l = checkAtrule(i)) i += l;
    else break;
  }

  if (i !== blockEnd + 1) return 0;

  return blockEnd + 1 - start;
}
1198136
static Statement ifElseChain(final List<IfBlock> ifs, final Optional<Statement> elseBlock) {
    checkArgument(!ifs.isEmpty());
    return new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        Label end = new Label();
        Label next;
        for (int i = 0; i < ifs.size(); i++) {
          IfBlock curr = ifs.get(i);
          boolean isLastIfBlock = i == ifs.size() - 1;
          if (isLastIfBlock && !elseBlock.isPresent()) {
            next = end;
          } else {
            next = new Label();
          }
          curr.condition().gen(adapter);
          adapter.ifZCmp(Opcodes.IFEQ, next);
          curr.block().gen(adapter);
          if (end != next) {
            adapter.goTo(end);
          }
          adapter.mark(next);
        }
        if (elseBlock.isPresent()) {
          elseBlock.get().gen(adapter);
          adapter.mark(end);
        }
      }
    };
  }
1211913
function parseComponentBlockParams(element, program) {
      var l = element.attributes.length;
      var attrNames = [];

      for (var i = 0; i < l; i++) {
        attrNames.push(element.attributes[i].name);
      }

      var asIndex = attrNames.indexOf('as');

      if (asIndex !== -1 && l > asIndex && attrNames[asIndex + 1].charAt(0) === '|') {
        // Some basic validation, since we're doing the parsing ourselves
        var paramsString = attrNames.slice(asIndex).join(' ');
        if (paramsString.charAt(paramsString.length - 1) !== '|' || paramsString.match(/\|/g).length !== 2) {
          throw new Error('Invalid block parameters syntax: \'' + paramsString + '\'');
        }

        var params = [];
        for (i = asIndex + 1; i < l; i++) {
          var param = attrNames[i].replace(/\|/g, '');
          if (param !== '') {
            if (ID_INVERSE_PATTERN.test(param)) {
              throw new Error('Invalid identifier for block parameters: \'' + param + '\' in \'' + paramsString + '\'');
            }
            params.push(param);
          }
        }

        if (params.length === 0) {
          throw new Error('Cannot use zero block parameters: \'' + paramsString + '\'');
        }

        element.attributes = element.attributes.slice(0, asIndex);
        program.blockParams = params;
      }
    }
862831
public int lookupBlockName(String blockName) {
        Integer blockNoWrapper = blockNameToNoMap.get(blockName.toUpperCase());
        if (blockNoWrapper == null) {
            return -1;
        }
        int blockNo = blockNoWrapper.intValue();
        return blockNo;
    }
939785
private int endCheckLabel()
    {
        int rv = END_UNREACHED;

        rv = next.endCheck();
        rv |= getIntProp(CONTROL_BLOCK_PROP, END_UNREACHED);

        return rv;
    }
407731
public boolean isBlockInvoke( DynamicFunctionSymbol dfs )
  {
    return dfs.getDisplayName().equals( BlockClass.INVOKE_METHOD_NAME ) && _context.compilingBlock();
  }
812300
def normalize_block
      statements = value.to_vool
      index = statements.length - 1
      snd = statements.statements[index]
      raise "Expecting Send #{snd.class}:#{snd}" unless snd.is_a?( Vool::SendStatement)
      statements.statements[index] = assignment( snd )
      statements
    end
889986
def determine_end_offset(block, tokens, source, expected_matcher)
      lines = source.lines
      last_line_number = lines.length
      end_offset = nil
      tokens.reverse_each do |token|
        # Break once we're through with the last line.
        break if token[0][0] != last_line_number

        # Look for expected match to block opener
        next if token[1] != expected_matcher
        next if token[1] == :on_kw && token[2] != END_STR

        # Raise if we've already found something that looks like a block end.
        raise AmbiguousSourceError.from_proc(block) if end_offset
        # Ending offset is the position of the ending token, plus the length of
        # that token.
        end_offset = token[0][1] + token[2].length
      end
      raise AmbiguousSourceError.from_proc(block) unless end_offset
      determine_end_offset_relative_to_source(end_offset, lines.last.length)
    end
1041279
public static void parseJsonToSingleRowBlock(
            JsonParser parser,
            SingleRowBlockWriter singleRowBlockWriter,
            BlockBuilderAppender[] fieldAppenders,
            Optional<Map<String, Integer>> fieldNameToIndex)
            throws IOException
    {
        if (parser.getCurrentToken() == START_ARRAY) {
            for (int i = 0; i < fieldAppenders.length; i++) {
                parser.nextToken();
                fieldAppenders[i].append(parser, singleRowBlockWriter);
            }
            if (parser.nextToken() != JsonToken.END_ARRAY) {
                throw new JsonCastException(format("Expected json array ending, but got %s", parser.getText()));
            }
        }
        else {
            verify(parser.getCurrentToken() == START_OBJECT);
            if (!fieldNameToIndex.isPresent()) {
                throw new JsonCastException("Cannot cast a JSON object to anonymous row type. Input must be a JSON array.");
            }
            boolean[] fieldWritten = new boolean[fieldAppenders.length];
            int numFieldsWritten = 0;

            while (parser.nextToken() != JsonToken.END_OBJECT) {
                if (parser.currentToken() != FIELD_NAME) {
                    throw new JsonCastException(format("Expected a json field name, but got %s", parser.getText()));
                }
                String fieldName = parser.getText().toLowerCase(Locale.ENGLISH);
                Integer fieldIndex = fieldNameToIndex.get().get(fieldName);
                parser.nextToken();
                if (fieldIndex != null) {
                    if (fieldWritten[fieldIndex]) {
                        throw new JsonCastException("Duplicate field: " + fieldName);
                    }
                    fieldWritten[fieldIndex] = true;
                    numFieldsWritten++;
                    fieldAppenders[fieldIndex].append(parser, singleRowBlockWriter.getFieldBlockBuilder(fieldIndex));
                }
                else {
                    parser.skipChildren();
                }
            }

            if (numFieldsWritten != fieldAppenders.length) {
                for (int i = 0; i < fieldWritten.length; i++) {
                    if (!fieldWritten[i]) {
                        singleRowBlockWriter.getFieldBlockBuilder(i).appendNull();
                    }
                }
            }
        }
    }
286728
private boolean isBlockFinalizedWithLock(int namespaceId, Block b) {
    lock.readLock().lock();
    try {
      return isBlockFinalizedInternal(namespaceId, b, true);
    } finally {
      lock.readLock().unlock();
    }
  }
727053
def _find_block_end(self, table, used_cells, block_start, block_end, start_pos, end_pos):
        '''
        
        '''
        table_row = table[block_start[0]]
        used_row = used_cells[block_start[0]]
        table_transpose = TableTranspose(table)

        # Find which column the titles end on
        for column_index in range(block_start[1], end_pos[1] + 1):
            # Ensure we catch the edge case of the data reaching the edge of the table -- block_end
            # should then equal end_pos
            block_end[1] = max(block_end[1], column_index)
            if column_index == end_pos[1]:
                break
            if used_row[column_index]:
                break
            elif is_empty_cell(table_row[column_index]):
                table_column = table_transpose[column_index]
                found_cell = False
                for row_index in range(block_start[0], block_end[0]):
                    if not is_empty_cell(table_column[row_index]):
                        found_cell = True
                        break
                # If we have a column of blanks, stop
                if not found_cell:
                    break
        return block_start, block_end
157212
function blocks(ast) {
  const body = [ast];
  // start with body of function
  const nodes = getBlocks(ast.body.body);
  if (nodes.length) {
    const { props } = nodes.reduce(everyBlock, { keysUsed: [], props: [] });
    body.push(t.expressionStatement(t.assignmentExpression(
      '=',
      c.BLOCKS,
      t.objectExpression(props)
    )));
  }

  return body;
}
832784
function (block, buffer, offset) {
    var start = offset % block
    var length = buffer.readUInt16LE(start)
    if(length === block - 1)
      return null
    else {
      var _length = buffer.readUInt16LE(start+2+length)
      if(_length != length)
        throw new Error('expected matching length at end, expected:'+length+', was:'+_length)
      result.offset = offset
      result.start = start+2
      result.length = length
      return result
    }
  }
57338
def find_block_end(row, line_list, sentinal, direction=1):
    
    import re
    row_ = row
    line_ = line_list[row_]
    flag1 = row_ == 0 or row_ == len(line_list) - 1
    flag2 = re.match(sentinal, line_)
    if not (flag1 or flag2):
        while True:
            if (row_ == 0 or row_ == len(line_list) - 1):
                break
            line_ = line_list[row_]
            if re.match(sentinal, line_):
                break
            row_ += direction
    return row_
271918
def _find_valid_block(self, table, worksheet, flags, units, used_cells, start_pos, end_pos):
        '''
        
        '''
        for row_index in range(len(table)):
            if row_index < start_pos[0] or row_index > end_pos[0]:
                continue
            convRow = table[row_index]
            used_row = used_cells[row_index]
            for column_index, conv in enumerate(convRow):
                if (column_index < start_pos[1] or column_index > end_pos[1] or used_row[column_index]):
                    continue
                # Is non empty cell?
                if not is_empty_cell(conv):
                    block_start, block_end = self._find_block_bounds(table, used_cells,
                            (row_index, column_index), start_pos, end_pos)
                    if (block_end[0] > block_start[0] and
                        block_end[1] > block_start[1]):
                        try:
                            return TableBlock(table, used_cells, block_start, block_end, worksheet,
                                flags, units, self.assume_complete_blocks, self.max_title_rows)
                        except InvalidBlockError:
                            pass
                        # Prevent infinite loops if something goes wrong
                        used_cells[row_index][column_index] = True