Sha256: 137bef79e136eccd0e68707e779d140ccb7754662cbafc5d84b0bb3483db02b1

Contents?: true

Size: 633 Bytes

Versions: 10

Compression:

Stored size: 633 Bytes

Contents

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

      def build(parent)
        if type.respond_to?(:build)
          result = type.build(parent)
          if result.kind_of?(String)
            result = Ast::Type.new(parent, result)
          end
        else
          result = Ast::Type.new(parent, type.text_value)
        end

        if result.kind_of? Ast::ScopedName
          result = Ast::Type.new parent, result.name # or qualified_name?
        end

        if suffix.any?
          suffix.apply(result)
        end

        result
      end

    end # Type
  end # ParseTree
end # WebIDL

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
webidl-0.2.2 lib/webidl/parse_tree/type.rb
webidl-0.2.1 lib/webidl/parse_tree/type.rb
webidl-0.1.10 lib/webidl/parse_tree/type.rb
webidl-0.2.0 lib/webidl/parse_tree/type.rb
webidl-0.1.9 lib/webidl/parse_tree/type.rb
webidl-0.1.8 lib/webidl/parse_tree/type.rb
webidl-0.1.7 lib/webidl/parse_tree/type.rb
webidl-0.1.6 lib/webidl/parse_tree/type.rb
webidl-0.1.5 lib/webidl/parse_tree/type.rb
webidl-0.1.4 lib/webidl/parse_tree/type.rb