From 2adec3226c0bf5ceb66136f7bb300b6d26b336d2 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Thu, 22 Dec 2016 21:15:20 +0200 Subject: [PATCH] opal gods require explicit requires --- lib/typed/method_compiler.rb | 13 ++++++++++++- lib/typed/tree.rb | 15 ++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/typed/method_compiler.rb b/lib/typed/method_compiler.rb index a0b0c0d5..fade9473 100644 --- a/lib/typed/method_compiler.rb +++ b/lib/typed/method_compiler.rb @@ -1,4 +1,15 @@ require_relative "tree" +require_relative "method_compiler/assignment" +require_relative "method_compiler/basic_values" +require_relative "method_compiler/call_site" +require_relative "method_compiler/collections" +require_relative "method_compiler/field_access" +require_relative "method_compiler/if_statement" +require_relative "method_compiler/name_expression" +require_relative "method_compiler/operator_expression" +require_relative "method_compiler/return_statement" +require_relative "method_compiler/statement_list" +require_relative "method_compiler/while_statement" module Typed @@ -9,7 +20,7 @@ module Typed "while_statement"] CompilerModules.each do |mod| - require_relative "method_compiler/" + mod +# require_relative "method_compiler/" + mod end # Compiling is the conversion of the AST into 2 things: diff --git a/lib/typed/tree.rb b/lib/typed/tree.rb index 76a8141d..37f4bdc7 100644 --- a/lib/typed/tree.rb +++ b/lib/typed/tree.rb @@ -7,11 +7,16 @@ module Typed end -["while_statement", "if_statement" , "return_statement" , "statements", - "operator_expression" , "field_access" , "call_site" , "basic_values", - "assignment" , "to_code"].each do |code| - require_relative "tree/" + code -end +require_relative "tree/while_statement" +require_relative "tree/if_statement" +require_relative "tree/return_statement" +require_relative "tree/statements" +require_relative "tree/operator_expression" +require_relative "tree/field_access" +require_relative "tree/call_site" +require_relative "tree/basic_values" +require_relative "tree/assignment" +require_relative "tree/to_code" AST::Node.class_eval do