-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLJS-3375: Bridge tools.reader (#178)
* add cljs.vendor.bridge file to bridge tools.reader and vendorized tools.reader * return clojure.tools.reader/*alias-map* first * only auto-bridge when invoking the REPL
- Loading branch information
1 parent
ebf9c6e
commit d1809c5
Showing
5 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
; Copyright (c) Rich Hickey. All rights reserved. | ||
; The use and distribution terms for this software are covered by the | ||
; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | ||
; which can be found in the file epl-v10.html at the root of this distribution. | ||
; By using this software in any fashion, you are agreeing to be bound by | ||
; the terms of this license. | ||
; You must not remove this notice, or any other, from this software. | ||
|
||
(ns cljs.vendor.bridge | ||
(:require [cljs.vendor.clojure.tools.reader.reader-types :as vendor] | ||
[clojure.tools.reader.reader-types :as readers])) | ||
|
||
(extend-protocol vendor/Reader | ||
clojure.tools.reader.reader_types.Reader | ||
(read-char [reader] | ||
(readers/read-char reader)) | ||
(peek-char [reader] | ||
(readers/peek-char reader))) | ||
|
||
(extend-protocol vendor/IPushbackReader | ||
clojure.tools.reader.reader_types.IPushbackReader | ||
(unread [reader ch] | ||
(readers/unread reader ch))) | ||
|
||
(extend-protocol vendor/IndexingReader | ||
clojure.tools.reader.reader_types.IndexingReader | ||
(get-line-number [reader] | ||
(readers/get-line-number reader)) | ||
(get-column-number [reader] | ||
(readers/get-column-number reader)) | ||
(get-file-name [reader] | ||
(readers/get-file-name reader))) | ||
|
||
(extend-protocol vendor/ReaderCoercer | ||
clojure.tools.reader.reader_types.ReaderCoercer | ||
(to-rdr [reader] | ||
(readers/to-rdr reader))) | ||
|
||
(extend-protocol vendor/PushbackReaderCoercer | ||
clojure.tools.reader.reader_types.PushbackReaderCoercer | ||
(to-pbr [reader buflen] | ||
(readers/to-pbr reader buflen))) |