Bläddra i källkod

Display identifiers and lists at the repl

master
Dylan Baker 6 år sedan
förälder
incheckning
691a5722aa
1 ändrade filer med 4 tillägg och 0 borttagningar
  1. 4
    0
      lib/chervil/repl.rb

+ 4
- 0
lib/chervil/repl.rb Visa fil

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

Laddar…
Avbryt
Spara