소스 검색

Display identifiers and lists at the repl

master
Dylan Baker 5 년 전
부모
커밋
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

Loading…
취소
저장