Skip to content

Commit 6e4c306

Browse files
committed
Rename within bin/
1 parent 124baa3 commit 6e4c306

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

bin/console

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# frozen_string_literal: true
33

44
$:.unshift(File.expand_path("../lib", __dir__))
5-
require "yarp"
5+
require "prism"
66

77
require "irb"
88
IRB.start(__FILE__)

bin/lex

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
$:.unshift(File.expand_path("../lib", __dir__))
1010
require "ripper"
11-
require "yarp"
11+
require "prism"
1212

1313
if ARGV[0] == "-e"
1414
source = ARGV[1]
@@ -21,33 +21,33 @@ pattern = "%-70s %-70s"
2121

2222
ripper =
2323
begin
24-
YARP.lex_ripper(source)
24+
Prism.lex_ripper(source)
2525
rescue ArgumentError, SyntaxError
2626
# If Ripper raises a syntax error, we want to continue as if it didn't
27-
# return any tokens at all. YARP won't raise a syntax error, so it's nicer
28-
# to still be able to see the tokens that YARP generated.
27+
# return any tokens at all. prism won't raise a syntax error, so it's nicer
28+
# to still be able to see the tokens that prism generated.
2929
[]
3030
end
3131

32-
yarp = YARP.lex_compat(source, filepath)
33-
if yarp.errors.any?
32+
prism = Prism.lex_compat(source, filepath)
33+
if prism.errors.any?
3434
puts "Errors lexing:"
35-
yarp.errors.map do |error|
35+
prism.errors.map do |error|
3636
print "- [#{error.location.start_line},#{error.location.start_column}-"
3737
print "#{error.location.end_line},#{error.location.end_column}] "
3838
puts "\e[1;31m#{error.message}\e[0m"
3939
end
4040
puts "\n"
4141
end
4242

43-
puts pattern % ["Ripper lex", "YARP lex"]
43+
puts pattern % ["Ripper lex", "Prism lex"]
4444
puts pattern % ["-" * 70, "-" * 70]
4545

46-
yarp_value = yarp.value
46+
prism_value = prism.value
4747

48-
[yarp_value.length, ripper.length].max.times do |index|
48+
[prism_value.length, ripper.length].max.times do |index|
4949
left = ripper[index]
50-
right = yarp_value[index]
50+
right = prism_value[index]
5151

5252
color = left == right ? "38;5;102" : "1;31"
5353

bin/locals

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# frozen_string_literal: true
33

44
$:.unshift(File.expand_path("../lib", __dir__))
5-
require "yarp"
5+
require "prism"
66

77
source = ARGV[0] == "-e" ? ARGV[1] : File.read(ARGV[0] || "test.rb")
88

99
puts "CRuby:"
10-
p YARP.const_get(:Debug).cruby_locals(source)
10+
p Prism.const_get(:Debug).cruby_locals(source)
1111

12-
puts "YARP:"
13-
p YARP.const_get(:Debug).yarp_locals(source)
12+
puts "Prism:"
13+
p Prism.const_get(:Debug).prism_locals(source)

bin/parse

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
# bin/parse -e "<source-code>"
88

99
$:.unshift(File.expand_path("../lib", __dir__))
10-
require "yarp"
10+
require "prism"
1111

1212
if ARGV[0] == "-e"
13-
result = YARP.parse(ARGV[1])
13+
result = Prism.parse(ARGV[1])
1414
else
15-
result = YARP.parse_file(ARGV[0] || "test.rb")
15+
result = Prism.parse_file(ARGV[0] || "test.rb")
1616
end
1717

1818
result.mark_newlines! if ENV["MARK_NEWLINES"]
1919

2020
value = result.value
21-
value = value.accept(YARP::DesugarCompiler.new) if ENV["DESUGAR"]
21+
value = value.accept(Prism::DesugarCompiler.new) if ENV["DESUGAR"]
2222

2323
parts = {}
2424
parts["Comments"] = result.comments if result.comments.any?

0 commit comments

Comments
 (0)