[Groonga-commit] groonga/groonga at 6efd1f5 [master] expr optimize: accept all tables as function arguments

Back to archive index
Kouhei Sutou null+****@clear*****
Mon Mar 4 11:59:16 JST 2019


Kouhei Sutou	2019-03-04 11:59:16 +0900 (Mon, 04 Mar 2019)

  Revision: 6efd1f5f205c10da0488ac820ef1ece696539e13
  https://github.com/groonga/groonga/commit/6efd1f5f205c10da0488ac820ef1ece696539e13

  Message:
    expr optimize: accept all tables as function arguments

  Added files:
    lib/mrb/scripts/expression_tree/table.rb
  Removed files:
    lib/mrb/scripts/expression_tree/options.rb
  Modified files:
    lib/mrb/scripts/expression_tree.rb
    lib/mrb/scripts/expression_tree/sources.am
    lib/mrb/scripts/expression_tree_builder.rb

  Modified: lib/mrb/scripts/expression_tree.rb (+1 -1)
===================================================================
--- lib/mrb/scripts/expression_tree.rb    2019-03-04 11:51:00 +0900 (6137ff8ca)
+++ lib/mrb/scripts/expression_tree.rb    2019-03-04 11:59:16 +0900 (f789f7a81)
@@ -4,7 +4,7 @@ require "expression_tree/constant"
 require "expression_tree/function_call"
 require "expression_tree/index_column"
 require "expression_tree/logical_operation"
-require "expression_tree/options"
 require "expression_tree/procedure"
+require "expression_tree/table"
 require "expression_tree/unary_operation"
 require "expression_tree/variable"

  Deleted: lib/mrb/scripts/expression_tree/options.rb (+0 -14) 100644
===================================================================
--- lib/mrb/scripts/expression_tree/options.rb    2019-03-04 11:51:00 +0900 (1504b57a2)
+++ /dev/null
@@ -1,14 +0,0 @@
-module Groonga
-  module ExpressionTree
-    class Options
-      attr_reader :object
-      def initialize(object)
-        @object = object
-      end
-
-      def build(expression)
-        expression.append_object(@object, Operator::PUSH, 1)
-      end
-    end
-  end
-end

  Modified: lib/mrb/scripts/expression_tree/sources.am (+1 -1)
===================================================================
--- lib/mrb/scripts/expression_tree/sources.am    2019-03-04 11:51:00 +0900 (f9955ccc7)
+++ lib/mrb/scripts/expression_tree/sources.am    2019-03-04 11:59:16 +0900 (0bfb385f4)
@@ -5,7 +5,7 @@ RUBY_SCRIPT_FILES =				\
 	function_call.rb			\
 	index_column.rb				\
 	logical_operation.rb			\
-	options.rb				\
 	procedure.rb				\
+	table.rb				\
 	unary_operation.rb			\
 	variable.rb

  Added: lib/mrb/scripts/expression_tree/table.rb (+14 -0) 100644
===================================================================
--- /dev/null
+++ lib/mrb/scripts/expression_tree/table.rb    2019-03-04 11:59:16 +0900 (530dbdacc)
@@ -0,0 +1,14 @@
+module Groonga
+  module ExpressionTree
+    class Table
+      attr_reader :table
+      def initialize(table)
+        @table = table
+      end
+
+      def build(expression)
+        expression.append_object(@table, Operator::PUSH, 1)
+      end
+    end
+  end
+end

  Modified: lib/mrb/scripts/expression_tree_builder.rb (+2 -2)
===================================================================
--- lib/mrb/scripts/expression_tree_builder.rb    2019-03-04 11:51:00 +0900 (1a5f1eb5a)
+++ lib/mrb/scripts/expression_tree_builder.rb    2019-03-04 11:59:16 +0900 (ca0190b0b)
@@ -94,8 +94,8 @@ module Groonga
             node = ExpressionTree::IndexColumn.new(code.value)
           when Accessor
             node = ExpressionTree::Accessor.new(code.value)
-          when HashTable
-            node = ExpressionTree::Options.new(code.value)
+          when Table
+            node = ExpressionTree::Table.new(code.value)
           else
             node = ExpressionTree::Constant.new(code.value.value)
           end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20190304/e4c98338/attachment-0001.html>


More information about the Groonga-commit mailing list
Back to archive index