Check all blocks and load those that are 'rapidoc actions block'

 @param lines [Array] lines that contain comments
 @param blocks [Hash] lines of blocks, example: { init: 1, end: 4 }
 @return [Array] all actions info
352624
def extract_actions_info( lines, blocks, file_name )
      info = []
      blocks = [] unless blocks

      blocks.each do |b|
        if lines[ b[:init] ].include? "=begin action"
          n_lines = b[:end] - b[:init] - 1

          begin
            info << YAML.load( lines[ b[:init] + 1, n_lines ].join.gsub(/\ *#/, '') )
          rescue Exception => e
            puts "Error parsing block in #{file_name} file [#{b[:init]} - #{b[:end]}]"
          end
        end
      end

      return info
    end
558057
public AppleScriptBuilder withLines(List<String> lines) {
        for (String line : lines) {
            withLine(line);
        }
        return this;
    }
260338
def _compile(cls, lines):
        ''''''
        m = cls.RE_PASTE.match(lines.current)
        if m is None:
            raise MacroBlockUsageError(
                'Incorrect macro or block usage at line {}, {}\nShould be '
                'something like: #my_macro'.format(lines.pos, lines.current))
        return m.group(1)
1369428
def _blockedPairs(self, blocks):
        

        block, blocks = core.peek(blocks)
        self._checkBlock(block)

        combinations = itertools.combinations

        pairs = (combinations(sorted(block), 2) for block in blocks)

        return pairs
738817
def highlightBlock(self, block):
        

        self.highlight_text(block, 0, len(block))
        self.setCurrentBlockState(0)

        state = 1
        for rule in self.rules:
            if re.match("comment\.block\.[\w\.]*start", rule.name):
                format = self.formats.get_format(rule.name) or self.formats.get_format("default")
                if self.highlight_multiline_block(block, rule.pattern,
                                                  foundations.common.get_first_item([item for item in self.rules
                                                                                     if item.name == rule.name.replace(
                                                              "start", "end")]).pattern, state, format):
                    break
                state += 1
936597
protected function parseDocBlock( $lines )
	{
		$data		= array();
		$descLines	= array();
		foreach( $lines as $line )
		{
			if( preg_match( $this->regexDocParam, $line, $matches ) )
			{
				$data['param'][$matches[4]]	= $this->parseDocParameter( $matches );
			}
			else if( preg_match( "@\*\s+\@return\s+(\w+)\s*(.+)?$@i", $line, $matches ) )
			{
				$data['return']	= $this->parseDocReturn( $matches );
			}
			else if( preg_match( "@\*\s+\@throws\s+(\w+)\s*(.+)?$@i", $line, $matches ) )
			{
				$data['throws'][]	= $this->parseDocThrows( $matches );
			}
			else if( preg_match( "@\*\s+\@trigger\s+(\w+)\s*(.+)?$@i", $line, $matches ) )
			{
				$data['trigger'][]	= $this->parseDocTrigger( $matches );
			}
			else if( preg_match( "@\*\s+\@author\s+(.+)\s*(<(.+)>)?$@iU", $line, $matches ) )
			{
				$author	= new ADT_PHP_Author( trim( $matches[1] ) );
				if( isset( $matches[3] ) )
					$author->setEmail( trim( $matches[3] ) );
				$data['author'][]	= $author;
			}
			else if( preg_match( "@\*\s+\@license\s+(\S+)( .+)?$@i", $line, $matches ) )
			{
				$data['license'][]	= $this->parseDocLicense( $matches );
			}
			else if( preg_match( "/^\*\s+@(\w+)\s*(.*)$/", $line, $matches ) )
			{
				switch( $matches[1] )
				{
					case 'implements':
					case 'deprecated':
					case 'todo':
					case 'copyright':
					case 'see':
					case 'uses':
					case 'link':
						$data[$matches[1]][]	= $matches[2];			
						break;
					case 'since':
					case 'version':
					case 'access':
					case 'category':
					case 'package':
					case 'subpackage':
						$data[$matches[1]]	= $matches[2];			
						break;
					default:
						break;
				}
			}
			else if( !$data && preg_match( "/^\*\s*([^@].+)?$/", $line, $matches ) )
				$descLines[]	= isset( $matches[1] ) ? trim( $matches[1] ) : "";
		}
		$data['description']	= trim( implode( "\n", $descLines ) );

		if( !isset( $data['throws'] ) )
			$data['throws']	= array();
		return $data;
	}
848086
def iterateBlocksBackFrom(block):
        
        count = 0
        while block.isValid() and count < MAX_SEARCH_OFFSET_LINES:
            yield block
            block = block.previous()
            count += 1
933311
def run(self, lines):
        
        text = "\n".join(lines)
        while 1:
            m = FENCED_BLOCK_RE.search(text)
            if not m:
                break
            lang = m.group('lang')
            linenums = bool(m.group('linenums'))
            html = highlight_syntax(m.group('code'), lang, linenums=linenums)
            placeholder = self.markdown.htmlStash.store(html, safe=True)
            text = '{}\n{}\n{}'.format(
                text[:m.start()],
                placeholder,
                text[m.end():]
            )

        return text.split("\n")
1222794
def marker_for_line(self, line):
        
        block = self.editor.document().findBlockByNumber(line)
        try:
            return block.userData().messages
        except AttributeError:
            return []
316212
def routes(&block)
      @routes ||= ActionDispatch::Routing::RouteSet.new_with_config(config)
      @routes.append(&block) if block_given?
      @routes
    end
785716
def _parse_blocks(instream):
    
    ilines = sugar.unblank(instream)
    for line in ilines:
        if line.startswith('['):
            # Start of block
            level, one, name, seqcount, params = _parse_block_header(line)
            qlen, qchars = _parse_block_postheader(next(ilines))
            # Pass control to the sequence parser
            sequences = list(_parse_sequences(ilines, qlen))
            # Validation
            if not len(sequences) == seqcount:
                logging.warn("Expected %d sequences in block %s, found %d",
                             seqcount, name, len(sequences))
            yield {'level': level,
                   'one': one,
                   'name': name,
                   # 'seqcount': seqcount,
                   'params': params,
                   'query_length': qlen,
                   'query_chars': qchars,
                   'sequences': sequences,
                   }
1025576
def iter_lines(self, section):
        
        try:
            section = self._get_section(section, create=False)
        except KeyError:
            return

        for block in section:
            for line in block:
                yield line
823791
def block(self):
        
        statements = []
        self.eat(TokenTypes.LBRACE)
        if self.cur_token.type == TokenTypes.NEW_LINE:
            self.eat(TokenTypes.NEW_LINE)
        while self.cur_token.type != TokenTypes.RBRACE:
            statements.append(self.statement())
        self.eat(TokenTypes.RBRACE)
        if self.cur_token.type == TokenTypes.NEW_LINE:
            self.eat(TokenTypes.NEW_LINE)
        return Block(statements)
1276429
def list(*args, &block) # :yield: line
      cmd = "LIST"
      args.each do |arg|
        cmd = cmd + " " + arg.to_s
      end
      if block
        retrlines(cmd, &block)
      else
        lines = []
        retrlines(cmd) do |line|
          lines << line
        end
        return lines
      end
    end
485984
def parse(self, lines):
        
        # states:
        #   0: start state
        #   1: saw user-agent line
        #   2: saw an allow or disallow line
        state = 0
        entry = Entry()

        for line in lines:
            if not line:
                if state == 1:
                    entry = Entry()
                    state = 0
                elif state == 2:
                    self._add_entry(entry)
                    entry = Entry()
                    state = 0
            # remove optional comment and strip line
            i = line.find('#')
            if i >= 0:
                line = line[:i]
            line = line.strip()
            if not line:
                continue
            line = line.split(':', 1)
            if len(line) == 2:
                line[0] = line[0].strip().lower()
                line[1] = urllib.parse.unquote(line[1].strip())
                if line[0] == "user-agent":
                    if state == 2:
                        self._add_entry(entry)
                        entry = Entry()
                    entry.useragents.append(line[1])
                    state = 1
                elif line[0] == "disallow":
                    if state != 0:
                        entry.rulelines.append(RuleLine(line[1], False))
                        state = 2
                elif line[0] == "allow":
                    if state != 0:
                        entry.rulelines.append(RuleLine(line[1], True))
                        state = 2
        if state == 2:
            self._add_entry(entry)
1198914
def list(lines, id, caption, lang = nil)
      if highlight_listings?
        common_code_block_lst(id, lines, 'reviewlistlst', 'caption', caption, lang)
      else
        common_code_block(id, lines, 'reviewlist', caption, lang) { |line, _idx| detab(line) + "\n" }
      end
    end
76432
function quickParseBlock() {
  const node = this.startNode();
  const prevPos = this.context.length - 1;

  node.body = [];

  do {
    this.next();
  } while (this.context.length > prevPos);

  this.next();
  return this.finishNode(node, "BlockStatement");
}