Sha256: 0514e806a9a710471f3efd1f808ca33324fad31b24181ea261e9818ade51065d

Contents?: true

Size: 602 Bytes

Versions: 14

Compression:

Stored size: 602 Bytes

Contents

module Finitio
  module Syntax
    module System
      include Node

      capture :imports, :definitions, :main_type

      def compile(system)
        imports.compile(system) if imports
        definitions.compile(system)
        main_type.compile(system) if main_type
        system
      end

      def to_ast
        ast = [ :system ]
        imports_ast = imports.to_ast
        ast << imports_ast unless imports_ast.size == 1
        ast += definitions.to_ast
        ast << main_type.to_ast if main_type
        ast
      end

    end # module System
  end # module Syntax
end # module Finitio

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
finitio-0.12.0 lib/finitio/syntax/system.rb
finitio-0.11.4 lib/finitio/syntax/system.rb
finitio-0.11.3 lib/finitio/syntax/system.rb
finitio-0.11.2 lib/finitio/syntax/system.rb
finitio-0.11.1 lib/finitio/syntax/system.rb
finitio-0.10.0 lib/finitio/syntax/system.rb
finitio-0.9.1 lib/finitio/syntax/system.rb
finitio-0.9.0 lib/finitio/syntax/system.rb
finitio-0.8.0 lib/finitio/syntax/system.rb
finitio-0.7.0 lib/finitio/syntax/system.rb
finitio-0.7.0.pre.rc4 lib/finitio/syntax/system.rb
finitio-0.7.0.pre.rc3 lib/finitio/syntax/system.rb
finitio-0.7.0.pre.rc2 lib/finitio/syntax/system.rb
finitio-0.7.0.pre.rc1 lib/finitio/syntax/system.rb