(char delim, PushbackReader r, boolean isRecursive, Object opts)
| 727 | } |
| 728 | |
| 729 | public static List readDelimitedList(char delim, PushbackReader r, boolean isRecursive, Object opts) { |
| 730 | final int firstline = |
| 731 | (r instanceof LineNumberingPushbackReader) ? |
| 732 | ((LineNumberingPushbackReader) r).getLineNumber() : -1; |
| 733 | |
| 734 | ArrayList a = new ArrayList(); |
| 735 | |
| 736 | for(; ;) |
| 737 | { |
| 738 | int ch = read1(r); |
| 739 | |
| 740 | while(isWhitespace(ch)) |
| 741 | ch = read1(r); |
| 742 | |
| 743 | if(ch == -1) |
| 744 | { |
| 745 | if(firstline < 0) |
| 746 | throw Util.runtimeException("EOF while reading"); |
| 747 | else |
| 748 | throw Util.runtimeException("EOF while reading, starting at line " + firstline); |
| 749 | } |
| 750 | |
| 751 | if(ch == delim) |
| 752 | break; |
| 753 | |
| 754 | IFn macroFn = getMacro(ch); |
| 755 | if(macroFn != null) |
| 756 | { |
| 757 | Object mret = macroFn.invoke(r, (char) ch, opts); |
| 758 | //no op macros return the reader |
| 759 | if(mret != r) |
| 760 | a.add(mret); |
| 761 | } |
| 762 | else |
| 763 | { |
| 764 | unread(r, ch); |
| 765 | |
| 766 | Object o = read(r, true, null, isRecursive, opts); |
| 767 | if(o != r) |
| 768 | a.add(o); |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | |
| 773 | return a; |
| 774 | } |
| 775 | |
| 776 | public static class TaggedReader extends AFn{ |
| 777 | public Object invoke(Object reader, Object firstChar, Object opts){ |
no test coverage detected