Explorar el Código

Display identifiers and lists at the repl

master
Dylan Baker hace 5 años
padre
commit
691a5722aa
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4
    0
      lib/chervil/repl.rb

+ 4
- 0
lib/chervil/repl.rb Ver fichero

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

Loading…
Cancelar
Guardar