Sha256: 219d8de4742cccd5e4577fb201c7b5e6e337287d11a091dfe2a1ead26431a965

Contents?: true

Size: 980 Bytes

Versions: 7

Compression:

Stored size: 980 Bytes

Contents

module WebIDL
  module ParseTree
    class Operation < Treetop::Runtime::SyntaxNode

      def build(parent)
        if respond_to?(:specials)
          special_list = specials.build unless specials.empty?
          operation    = op
        else
          special_list = []
          operation    = self
        end

        typ        = operation.type.build(parent)
        name       = operation.optional_id.text_value unless operation.optional_id.empty?
        arguments  = operation.args.build(parent) unless operation.args.empty?
        raise_list = operation.raises.build unless operation.raises.empty?

        Ast::Operation.new(
          parent, typ,  :name     => name,
                        :specials => special_list,
                        :args     => arguments,
                        :raises   => raise_list,
                        :static   => respond_to?(:static) && !static.empty?
        )
      end

    end # Operation
  end # ParseTree
end # WebIDL

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
webidl-0.2.2 lib/webidl/parse_tree/operation.rb
webidl-0.2.1 lib/webidl/parse_tree/operation.rb
webidl-0.1.10 lib/webidl/parse_tree/operation.rb
webidl-0.2.0 lib/webidl/parse_tree/operation.rb
webidl-0.1.9 lib/webidl/parse_tree/operation.rb
webidl-0.1.8 lib/webidl/parse_tree/operation.rb
webidl-0.1.7 lib/webidl/parse_tree/operation.rb