Skip to content

Commit 8ebfd88

Browse files
committed
Change primitive names.
1 parent ef85f9e commit 8ebfd88

File tree

14 files changed

+56
-56
lines changed

14 files changed

+56
-56
lines changed

lib/truffle/stringio.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ def gets(sep=$/, limit=Undefined)
315315

316316
# Truffle: $_ is thread and frame local, so we use a primitive to
317317
# set it in the caller's frame.
318-
Primitive.io_last_line_set(Primitive.caller_special_variable, getline(false, sep, limit))
318+
Primitive.io_last_line_set(Primitive.caller_special_variables, getline(false, sep, limit))
319319
end
320320

321321
def isatty
@@ -346,7 +346,7 @@ def pos=(pos)
346346

347347
def print(*args)
348348
check_writable
349-
args << Primitive.io_last_line_get(Primitive.caller_special_variable) if args.empty?
349+
args << Primitive.io_last_line_get(Primitive.caller_special_variables) if args.empty?
350350
write((args << $\).flatten.join)
351351
nil
352352
end
@@ -449,7 +449,7 @@ def readline(sep=$/, limit=Undefined)
449449
check_readable
450450
raise EOFError, 'end of file reached' if eof?
451451

452-
Primitive.io_last_line_set(Primitive.caller_special_variable, getline(true, sep, limit))
452+
Primitive.io_last_line_set(Primitive.caller_special_variables, getline(true, sep, limit))
453453
end
454454

455455
def readlines(sep=$/, limit=Undefined)

lib/truffle/truffle/cext.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ def rb_tr_writable(mode)
17001700
end
17011701

17021702
def rb_backref_get
1703-
Primitive.regexp_last_match_get(Truffle::ThreadOperations.ruby_caller_special_variable([Truffle::CExt, Truffle::Interop.singleton_class]))
1703+
Primitive.regexp_last_match_get(Truffle::ThreadOperations.ruby_caller_special_variables([Truffle::CExt, Truffle::Interop.singleton_class]))
17041704
end
17051705

17061706
def rb_gv_set(name, value)
@@ -1718,7 +1718,7 @@ def rb_gv_get(name)
17181718

17191719
def rb_reg_match(re, str)
17201720
result = str ? Truffle::RegexpOperations.match(re, str, 0) : nil
1721-
Primitive.regexp_last_match_set(Truffle::ThreadOperations.ruby_caller_special_variable([Truffle::CExt, Truffle::Interop.singleton_class]), result)
1721+
Primitive.regexp_last_match_set(Truffle::ThreadOperations.ruby_caller_special_variables([Truffle::CExt, Truffle::Interop.singleton_class]), result)
17221722

17231723
result.begin(0) if result
17241724
end

src/main/java/org/truffleruby/core/kernel/TruffleKernelNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public static GetSpecialVariableStorage create() {
342342
}
343343
}
344344

345-
@Primitive(name = "caller_special_variable")
345+
@Primitive(name = "caller_special_variables")
346346
public abstract static class GetCallerSpecialVariableStorage extends PrimitiveArrayArgumentsNode {
347347

348348
@Child ReadCallerStorageNode callerStorageNode = new ReadCallerStorageNode();
@@ -353,7 +353,7 @@ protected Object storage(VirtualFrame frame) {
353353
}
354354
}
355355

356-
@Primitive(name = "proc_special_variable")
356+
@Primitive(name = "proc_special_variables")
357357
public abstract static class GetProcSpecialVariableStorage extends PrimitiveArrayArgumentsNode {
358358

359359
@Specialization

src/main/java/org/truffleruby/core/thread/TruffleThreadNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected Object findRubyCaller(RubyArray modules,
5151

5252
}
5353

54-
@CoreMethod(names = "ruby_caller_special_variable", onSingleton = true, required = 1)
54+
@CoreMethod(names = "ruby_caller_special_variables", onSingleton = true, required = 1)
5555
@ImportStatic(ArrayGuards.class)
5656
public abstract static class FindRubyCallerSpecialStorage extends CoreMethodArrayArgumentsNode {
5757

src/main/ruby/truffleruby/core/argf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def gets(sep=$/)
294294
next
295295
end
296296

297-
Primitive.io_last_line_set(Primitive.caller_special_variable, line) if line
297+
Primitive.io_last_line_set(Primitive.caller_special_variables, line) if line
298298
@last_lineno = @lineno += 1
299299
return line
300300
end

src/main/ruby/truffleruby/core/enumerable.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def grep(pattern, &block)
356356
each do
357357
o = Primitive.single_block_arg
358358
matches = pattern === o
359-
Primitive.regexp_last_match_set(Primitive.proc_special_variable(block), $~)
359+
Primitive.regexp_last_match_set(Primitive.proc_special_variables(block), $~)
360360
if matches
361361
ary << yield(o)
362362
end
@@ -369,7 +369,7 @@ def grep(pattern, &block)
369369
end
370370
end
371371

372-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, $~)
372+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, $~)
373373
end
374374

375375
ary
@@ -382,7 +382,7 @@ def grep_v(pattern, &block)
382382
each do
383383
o = Primitive.single_block_arg
384384
matches = pattern === o
385-
Primitive.regexp_last_match_set(Primitive.proc_special_variable(block), $~)
385+
Primitive.regexp_last_match_set(Primitive.proc_special_variables(block), $~)
386386
unless matches
387387
ary << yield(o)
388388
end
@@ -395,7 +395,7 @@ def grep_v(pattern, &block)
395395
end
396396
end
397397

398-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, $~)
398+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, $~)
399399
end
400400

401401
ary

src/main/ruby/truffleruby/core/enumerator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def reject
386386
end
387387

388388
def grep(pattern, &block)
389-
s = block ? Primitive.proc_special_variable(block) : Primitive.caller_special_variable
389+
s = block ? Primitive.proc_special_variables(block) : Primitive.caller_special_variables
390390

391391
Lazy.new(self, nil) do |yielder, *args|
392392
val = args.length >= 2 ? args : args.first
@@ -404,7 +404,7 @@ def grep(pattern, &block)
404404
end
405405

406406
def grep_v(pattern, &block)
407-
s = block ? Primitive.proc_special_variable(block) : Primitive.caller_special_variable
407+
s = block ? Primitive.proc_special_variables(block) : Primitive.caller_special_variables
408408

409409
Lazy.new(self, nil) do |yielder, *args|
410410
val = args.length >= 2 ? args : args.first

src/main/ruby/truffleruby/core/io.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ def gets(sep_or_limit=$/, limit=nil)
16371637
line = l
16381638
break
16391639
end
1640-
Primitive.io_last_line_set(Primitive.caller_special_variable, line) if line
1640+
Primitive.io_last_line_set(Primitive.caller_special_variables, line) if line
16411641
line
16421642
end
16431643

@@ -1746,7 +1746,7 @@ def pos=(offset)
17461746
# IO#gets) if called without arguments. Appends $\.to_s to output. Returns
17471747
# nil.
17481748
def print(*args)
1749-
Truffle::IOOperations.print self, args, Primitive.caller_special_variable
1749+
Truffle::IOOperations.print self, args, Primitive.caller_special_variables
17501750
end
17511751

17521752
##

src/main/ruby/truffleruby/core/kernel.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def =~(other)
188188

189189
def !~(other)
190190
r = self =~ other ? false : true
191-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, $~)
191+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, $~)
192192
r
193193
end
194194

@@ -366,7 +366,7 @@ def getc
366366

367367
def gets(*args)
368368
line = ARGF.gets(*args)
369-
Primitive.io_last_line_set(Primitive.caller_special_variable, line) if line
369+
Primitive.io_last_line_set(Primitive.caller_special_variables, line) if line
370370
line
371371
end
372372
module_function :gets
@@ -769,17 +769,17 @@ def fork
769769
Truffle::Boot.delay do
770770
if Truffle::Boot.get_option('gets-loop')
771771
def chomp(separator=$/)
772-
last_line = Primitive.io_last_line_get(Primitive.caller_special_variable)
772+
last_line = Primitive.io_last_line_get(Primitive.caller_special_variables)
773773
result = Truffle::KernelOperations.check_last_line(last_line).chomp(separator)
774-
Primitive.io_last_line_set(Primitive.caller_special_variable, result)
774+
Primitive.io_last_line_set(Primitive.caller_special_variables, result)
775775
result
776776
end
777777
module_function :chomp
778778

779779
def chop
780-
last_line = Primitive.io_last_line_get(Primitive.caller_special_variable)
780+
last_line = Primitive.io_last_line_get(Primitive.caller_special_variables)
781781
result = Truffle::KernelOperations.check_last_line(last_line).chop
782-
Primitive.io_last_line_set(Primitive.caller_special_variable, result)
782+
Primitive.io_last_line_set(Primitive.caller_special_variables, result)
783783
result
784784
end
785785
module_function :chop

src/main/ruby/truffleruby/core/regexp.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def self.compatible?(*patterns)
7878
end
7979

8080
def self.last_match(index=nil)
81-
match = Primitive.regexp_last_match_get(Primitive.caller_special_variable)
81+
match = Primitive.regexp_last_match_get(Primitive.caller_special_variables)
8282
if index
8383
index = Primitive.rb_to_int index
8484
match[index] if match
@@ -146,18 +146,18 @@ def initialize(pattern, opts=nil, lang=nil)
146146

147147
def =~(str)
148148
result = str ? Truffle::RegexpOperations.match(self, str, 0) : nil
149-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, result)
149+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, result)
150150

151151
result.begin(0) if result
152152
end
153153

154154
def match(str, pos=0)
155155
unless str
156-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, nil)
156+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, nil)
157157
return nil
158158
end
159159
result = Truffle::RegexpOperations.match(self, str, pos)
160-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, result)
160+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, result)
161161

162162
if result && block_given?
163163
yield result
@@ -176,16 +176,16 @@ def ===(other)
176176
elsif !other.kind_of? String
177177
other = Truffle::Type.rb_check_convert_type other, String, :to_str
178178
unless other
179-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, nil)
179+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, nil)
180180
return false
181181
end
182182
end
183183

184184
if match = match_from(other, 0)
185-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, match)
185+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, match)
186186
true
187187
else
188-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, nil)
188+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, nil)
189189
false
190190
end
191191
end
@@ -211,10 +211,10 @@ def encoding
211211
end
212212

213213
def ~
214-
line = Primitive.io_last_line_get(Primitive.caller_special_variable)
214+
line = Primitive.io_last_line_get(Primitive.caller_special_variables)
215215

216216
unless line.kind_of?(String)
217-
Primitive.regexp_last_match_set(Primitive.caller_special_variable, nil)
217+
Primitive.regexp_last_match_set(Primitive.caller_special_variables, nil)
218218
return nil
219219
end
220220

0 commit comments

Comments
 (0)