Create DSL block

 @param [Symbol, String] block name
 @param [String] parameter that is passed in to block
 @return [String] DSL block string
423551
def block name, param = nil, &b
      sp = ' '*2 if name == :lang || name == :languages
      body = yield self if block_given?
      param = ":#{param.to_s}" unless param.nil?
      "#{sp}#{name.to_s} #{param} do\n#{body}\n#{sp}end\n"
    end
1350826
def blocks_name_declaration(mixin_node)
      block_name_declaration(DEFAULT_BLOCK_NAME)

      mixin_node.params.select { |n| n.type == :mixin_block_param }.each do |param|
        block_name_declaration(param.value)
      end
    end
631376
def p_namedblock(self, p):
        ''
        p[0] = Block(p[4], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
1052067
def p_block(self, p):
        ''
        p[0] = Block(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
55513
def visit_block_decl(current_node)
      params = formatted_mixin_params(current_node)
      buff_code "#{MIXINS_NAME}['#{current_node.name}'] = __create_mixin('#{current_node.name}', &lambda { |#{params}|"

      code_indent do
        blocks_name_declaration(current_node)
        visit_nodes(current_node.children - current_node.params)
      end

      buff_code '})'
    end
693382
def filter(name, callable=nil, &block)
      if block_given?
        transforms[name.to_sym] = block
      else
        transforms[name.to_sym] = callable
      end
    end
493585
function Block(options) {
  if (!(this instanceof Block))
    return new Block(options);

  AbstractBlock.call(this);

  this.txs = [];

  this._raw = null;
  this._size = -1;
  this._witness = -1;

  if (options)
    this.fromOptions(options);
}
601849
def call(name, given_options)
      # TODO: allow to receive rest of options/block in dynamic block. or, rather, test it as it was already implemented.
      evaluated_options = @dynamic_options.(name, given_options)

      options = Variables.merge( @static_options, handle_array_and_deprecate(evaluated_options) )
      options = Variables.merge( options, handle_array_and_deprecate(given_options) ) # FIXME: given_options is not tested!
    end
353468
def method_missing(name, *args, &block)
      if args.empty? && !block_given? && @arg_names.include?(name)
        @args[name]
      else
        super
      end
    end
476788
def method_missing name, *values, &block
      return @_items.send( name, *values, &block ) if @_items.respond_to? name     # @_items methods are highest priority

      name = name.to_s.chomp('=')

      if block_given?                                                  # block is a nested configuration
        if block.arity == 1                                            # yield DSL needs deferred block to set parent without binding
          return _set name, Configuration.new_defer_block_for_parent( self, @_options, &block )
        else
          return _set name, Configuration.new( nil, @_options, &block ) # eval DSL can set parent from block binding in initialize
        end
      end

      return _get name if values.empty?                               # just get item
      return _set name, values if values.size > 1                     # set item to multiple values
      return _set name, values.first                                  # set item to single value
    end
1339376
def make_node(cls, *args):
        
        new_args = []

        args = [x for x in args if not is_null(x)]
        for x in args:
            assert isinstance(x, Symbol)
            if x.token == 'BLOCK':
                new_args.extend(SymbolBLOCK.make_node(*x.children).children)
            else:
                new_args.append(x)

        result = SymbolBLOCK(*new_args)
        return result
731175
def get_block(self, block_name):
        
        # block_name = [block_name] if isinstance(
        #     block_name, str) else block_name
        # return QA_DataStruct_Stock_block(self.data[self.data.blockname.apply(lambda x: x in block_name)])

        return self.new(self.data.loc[(block_name, slice(None)), :])
9820
def method_missing(name, &block)
      @formats.push([name, block || proc {}]) unless @formats.any? {|n,b| n == name}
    end
149299
def create!(view_or_constant, style=nil, opts = {}, &block)
      opts[:raw_block] = block if block
      create(view_or_constant, style, opts).get
    end
1195042
function Block() {

  if( !(this instanceof Block) )
    return new Block()

  /** @type {Number} Entry / compression type */
  this.type = 0x00000000
  /** @type {String} Entry type name */
  this.description = 'UNKNOWN'
  /** @type {String} Comment ('+beg'|'+end' if type == COMMENT) */
  this.comment = ''
  /** @type {Number} Start sector of this chunk */
  this.sectorNumber = 0x0000000000000000
  /** @type {Number} Number of sectors in this chunk */
  this.sectorCount = 0x0000000000000000
  /** @type {Number} Start of chunk in data fork */
  this.compressedOffset = 0x0000000000000000
  /** @type {Number} Chunk's bytelength in data fork */
  this.compressedLength = 0x0000000000000000

}
451875
def declare!(inst, *args, &block)
      _indent
      @target << "<!#{inst}"
      args.each do |arg|
        case arg
        when ::String
          @target << %{ "#{arg}"} # " WART
        when ::Symbol
          @target << " #{arg}"
        end
      end
      if ::Kernel::block_given?
        @target << " ["
        _newline
        _nested_structures(block)
        @target << "]"
      end
      @target << ">"
      _newline
    end
361705
function parseBlockFunction( $funcName, &$args, $tpl, &$text, &$text_len, &$cur_pos,
                                 $relatedTemplateName, $startLine, $startColumn, $rootNamespace )
    {
        while ( $cur_pos < $text_len )
        {
            // parse parameter name
            $wordEndPos = $this->ElementParser->identifierEndPosition( $tpl, $text, $cur_pos, $text_len );
            $paramName  = substr( $text, $cur_pos, $wordEndPos-$cur_pos );
            $cur_pos    = $wordEndPos;
            if ( !$paramName )
            {
                $this->showParseErrorMessage( $tpl, $text, $text_len, $cur_pos, $relatedTemplateName, $startLine, $startColumn,
                                              $funcName, 'Empty parameter name' );
                return;
            }

            // skip whitespaces
            $cur_pos = $this->ElementParser->whitespaceEndPos( $tpl, $text, $cur_pos, $text_len );

            // skip (=)
            if ( $text[$cur_pos] != '=' )
            {
                $this->showParseErrorMessage( $tpl, $text, $text_len, $cur_pos, $relatedTemplateName, $startLine, $startColumn,
                                              $funcName, '(=) expected' );
                return;
            }
            $cur_pos++;

            // skip whitespaces
            $cur_pos = $this->ElementParser->whitespaceEndPos( $tpl, $text, $cur_pos, $text_len );

            // skip optional dollar sign
            if ( $paramName == 'variable' && $cur_pos < $text_len && $text[$cur_pos] == '$' )
            {
                $cur_pos++;
            }

            // parse parameter value
            $args[$paramName] = $this->ElementParser->parseVariableTag( $tpl, $relatedTemplateName, $text, $cur_pos, $cur_pos, $text_len, $rootNamespace );

            // skip whitespaces
            $cur_pos = $this->ElementParser->whitespaceEndPos( $tpl, $text, $cur_pos, $text_len );
        }
    }