Skip to content

Commit 1d54cec

Browse files
committed
Fix situation where not operator methods needed an argument
1 parent e31a44e commit 1d54cec

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

lib/core/false.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ def to_s
99
"false"
1010
end
1111

12-
def ! *args
13-
# FIXME: true is a keyword
12+
def !
1413
true
1514
end
1615

lib/core/nil.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def nil?
1313
true
1414
end
1515

16-
def ! *args
16+
def !
1717
true
1818
end
1919

lib/core/string.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def initialize *str
3232
)
3333
end
3434

35-
# FIXME: Shouldnt need arg
36-
def ! *arg
35+
def !
3736
false
3837
end
3938

lib/core/true.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
class TrueClass
33

4-
def ! x # FIXME: Why is it called with an argument?
4+
def !
55
false
66
end
77

transform.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def rewrite_operators(exp)
115115
next :skip if e[0] == :sexp
116116

117117
if e[0].is_a?(Symbol) && OPER_METHOD.member?(e[0].to_s)
118-
e[3] = E[e[2]]
118+
e[3] = E[e[2]] if e[2]
119119
e[2] = e[0]
120120
e[0] = :callm
121121
end
@@ -210,7 +210,6 @@ def find_vars(e, scopes, env, freq, in_lambda = false, in_assign = false)
210210

211211
def rewrite_env_vars(exp, env)
212212
exp.depth_first do |e|
213-
STDERR.puts e.inspect
214213
e.each_with_index do |ex, i|
215214
num = env.index(ex)
216215
if num
@@ -287,7 +286,6 @@ def rewrite_let_env(exp)
287286
def rewrite_range(exp)
288287
exp.depth_first do |e|
289288
if e[0] == :range
290-
STDERR.puts e.inspect
291289
e.replace(E[:callm, :Range, :new, e[1..-1]])
292290
end
293291
:next

0 commit comments

Comments
 (0)