Migrate toplevel code emitted as result of literals
[jscl.git] / src / read.lisp
index ceec883..6e9eb68 100644 (file)
@@ -16,6 +16,7 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with JSCL.  If not, see <http://www.gnu.org/licenses/>.
 
+(/debug "loading read.lisp!")
 
 ;;;; Reader
 
              (ls-read stream eof-error-p eof-value t)
              (prog2 (ls-read stream)
                  (ls-read stream eof-error-p eof-value t)))))
-      (#\J
+      ((#\J #\j)
        (unless (char= (%peek-char stream) #\:)
          (error "FFI descriptor must start with a semicolon."))
-       `(oget *root* ,(subseq (read-until stream #'terminalp) 1)))
+       (let ((descriptor (subseq (read-until stream #'terminalp) 1))
+             (subdescriptors nil))
+         (do* ((start 0 (1+ end))
+               (end (position #\: descriptor :start start)
+                    (position #\: descriptor :start start)))
+              ((null end)
+               (push (subseq descriptor start) subdescriptors)
+               `(oget *root* ,@(reverse subdescriptors)))
+           (push (subseq descriptor start end) subdescriptors))))
       (otherwise
        (cond
          ((and ch (digit-char-p ch))