Browse Source

Display identifiers and lists at the repl

master
Dylan Baker 5 years ago
parent
commit
691a5722aa
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      lib/chervil/repl.rb

+ 4
- 0
lib/chervil/repl.rb View File

@@ -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…
Cancel
Save