remove unused code

Arrays and Hashes have to resolve to object creation calls
Not to constants. In the future off course
This commit is contained in:
Torsten Ruger 2018-09-01 15:14:07 +03:00
parent f798173a09
commit 2bb6ad5f61
5 changed files with 8 additions and 49 deletions

View File

@ -1,6 +1,14 @@
module Ruby module Ruby
# Logical Statements are guaranteed to return boolean # Logical Statements are guaranteed to return boolean
# either :and or :or, which may be written as && and || # either :and or :or, which may be written as && and ||
#
# Also they guarantee that the right expression does not get evaluated
# if the whole expression fails on the left expression.
# ie: false && non_existant_method
# will never call the non_existant_method , but instead evaluate to false
#
# Vool has no concept of this, so the Statement is expanded into the if
# that it really is
class LogicalStatement < Statement class LogicalStatement < Statement
attr_reader :name , :left , :right attr_reader :name , :left , :right

View File

@ -1,13 +0,0 @@
module Vool
class ArrayStatement
attr_reader :values
def initialize( values )
@values = values
end
def length
@values.length
end
end
end

View File

@ -1,17 +0,0 @@
module Vool
class HashStatement
attr_reader :hash
def initialize( )
@hash = {}
end
def add(key , value)
@hash[key] = value
end
def length
@hash.length
end
end
end

View File

@ -1,16 +0,0 @@
module Vool
# Logical Statements are guaranteed to return boolean
# either :and or :or, which may be written as && and ||
class LogicalStatement < Statement
attr_reader :name , :left , :right
def initialize(name , left , right)
@name , @left , @right = name , left , right
end
def to_s(depth = 0)
at_depth(depth , "#{left} #{name} #{right}")
end
end
end

View File

@ -62,14 +62,11 @@ end
require_relative "assignment" require_relative "assignment"
require_relative "array_statement"
require_relative "basic_values" require_relative "basic_values"
require_relative "block_statement" require_relative "block_statement"
require_relative "call_statement" require_relative "call_statement"
require_relative "class_statement" require_relative "class_statement"
require_relative "hash_statement"
require_relative "if_statement" require_relative "if_statement"
require_relative "logical_statement"
require_relative "ivar_assignment" require_relative "ivar_assignment"
require_relative "local_assignment" require_relative "local_assignment"
require_relative "method_statement" require_relative "method_statement"