Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[cl-backend] take the unit name and mainline sub from the nam file
  • Loading branch information
pmurias committed Mar 6, 2011
1 parent 6fe05ff commit d85b4f0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions cl-backend/backend.lisp
Expand Up @@ -281,6 +281,12 @@



(defun wrap-in-unit-name (unit-name stmts)
"Set the name of the unit we are compiling"
`(let ((*unit-name* ,unit-name)) ,@stmts))

(defun compile-xref-table (xref)
(loop for thing in xref for i upfrom 0 when thing collect (compile-sub-or-packagoid i thing)))

(defun compile-unit (nam)
(fare-matcher:match nam
Expand All @@ -297,8 +303,10 @@
stash_root ; Trie holding classes and global variables
)

(list (niecza-stash:wrap-in-let stash_root
(loop for thing in xref for i upfrom 0 when thing collect (compile-sub-or-packagoid i thing)))))))
(wrap-in-unit-name name `(
,(niecza-stash:wrap-in-let stash_root (compile-xref-table xref))
(eval `(progn ,@preinit))
(,(xref-to-symbol mainline_ref)))))))


(defun print-thing (thing) (format t "~A" (FETCH thing)))
Expand Down Expand Up @@ -340,7 +348,7 @@
(|Nil| "") ; HACK
(|Any| "") ; HACK
)
,@compiled-unit (eval `(progn ,@preinit)) (,(main-xref 0))))
,compiled-unit ))

(let ((compiled-unit (compile-unit (json:decode-json (open (first common-lisp-user::*args*))))))
;(format t "~w~%~%~%" (json:decode-json (open (first *args*))))
Expand Down

0 comments on commit d85b4f0

Please sign in to comment.