Skip to content

Commit 29a52ab

Browse files
committed
Replace some chr calls with chr_utf_8
1 parent c0053c7 commit 29a52ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

alice.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def run
6868
iterator = @state.get_iterator
6969
case iterator
7070
when Integer
71-
iterator.times { @state.mode.process cell.chr }
71+
iterator.times { @state.mode.process cell.chr_utf_8 }
7272
when String
7373
iterator.each_char do |c|
7474
@state.push c
75-
@state.mode.process cell.chr
75+
@state.mode.process cell.chr_utf_8
7676
end
7777
end
7878
end

mode.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -940,10 +940,10 @@ def process cmd
940940
end
941941
end
942942
when :join_tape
943-
push @state.tape.keys.sort.map{|i| @state.tape[i]}.select{|v| is_char?(v)}.map(&:chr).join
943+
push @state.tape.keys.sort.map{|i| @state.tape[i]}.select{|v| is_char?(v)}.map(&:chr_utf_8).join
944944

945945
when :leave_string_mode
946-
push @state.current_string.select{|c| is_char? c }.map(&:chr).join
946+
push @state.current_string.select{|c| is_char? c }.map(&:chr_utf_8).join
947947
when :escape
948948
old_ip = @state.ip
949949
old_dir = @state.dir

0 commit comments

Comments
 (0)