(Object reader, Object mode, Object opts, Object pendingForms)
| 1627 | } |
| 1628 | |
| 1629 | public Object invoke(Object reader, Object mode, Object opts, Object pendingForms) { |
| 1630 | checkConditionalAllowed(opts); |
| 1631 | |
| 1632 | PushbackReader r = (PushbackReader) reader; |
| 1633 | int ch = read1(r); |
| 1634 | if (ch == -1) |
| 1635 | throw Util.runtimeException("EOF while reading character"); |
| 1636 | |
| 1637 | boolean splicing = false; |
| 1638 | |
| 1639 | if (ch == '@') { |
| 1640 | splicing = true; |
| 1641 | ch = read1(r); |
| 1642 | } |
| 1643 | |
| 1644 | while(isWhitespace(ch)) |
| 1645 | ch = read1(r); |
| 1646 | |
| 1647 | if (ch == -1) |
| 1648 | throw Util.runtimeException("EOF while reading character"); |
| 1649 | |
| 1650 | if(ch != '(') |
| 1651 | throw Util.runtimeException("read-cond body must be a list"); |
| 1652 | |
| 1653 | try { |
| 1654 | Var.pushThreadBindings(RT.map(READ_COND_ENV, RT.T)); |
| 1655 | |
| 1656 | if (isPreserveReadCond(opts)) { |
| 1657 | IFn listReader = getMacro(ch); // should always be a list |
| 1658 | Object form = listReader.invoke(r, ch, opts, ensurePending(pendingForms)); |
| 1659 | |
| 1660 | return ReaderConditional.create(form, splicing); |
| 1661 | } else { |
| 1662 | return readCondDelimited(r, splicing, opts, pendingForms); |
| 1663 | } |
| 1664 | } finally { |
| 1665 | Var.popThreadBindings(); |
| 1666 | } |
| 1667 | } |
| 1668 | } |
| 1669 | |
| 1670 | /* |
nothing calls this directly
no test coverage detected