Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[cl-backend] take the unit name and mainline sub from the nam file

  • Loading branch information...
commit d85b4f0c6f440667f8b9d8a1a7e0b0f3f2bd46f4 1 parent 6fe05ff
@pmurias pmurias authored
Showing with 11 additions and 3 deletions.
  1. +11 −3 cl-backend/backend.lisp
View
14 cl-backend/backend.lisp
@@ -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
@@ -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)))
@@ -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*))))
Please sign in to comment.
Something went wrong with that request. Please try again.