Просмотр исходного кода

Display identifiers and lists at the repl

master
Dylan Baker 6 лет назад
Родитель
Сommit
691a5722aa
1 измененных файлов: 4 добавлений и 0 удалений
  1. 4
    0
      lib/chervil/repl.rb

+ 4
- 0
lib/chervil/repl.rb Просмотреть файл

18
         "(#{obj.elements.map { |el| display(el) }.join(' ')})"
18
         "(#{obj.elements.map { |el| display(el) }.join(' ')})"
19
       when AST::Quotation
19
       when AST::Quotation
20
         "\'#{display(obj.value)}"
20
         "\'#{display(obj.value)}"
21
+      when AST::Identifier
22
+        obj.name
21
       when Float
23
       when Float
22
         if obj.floor.to_f == obj
24
         if obj.floor.to_f == obj
23
           obj.to_i
25
           obj.to_i
24
         else
26
         else
25
           obj
27
           obj
26
         end
28
         end
29
+      when Array
30
+        "(#{obj.map { |el| display(el) }.join(' ')})"
27
       else
31
       else
28
         obj
32
         obj
29
       end
33
       end

Загрузка…
Отмена
Сохранить