From: Alejandro R SedeƱo Date: Tue, 19 Mar 2013 20:28:41 +0000 (-0400) Subject: Allow import by symbol to support pure-lisp protobuf definitions X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=8ee40df915e75db44110aedbb484379581f708f4;p=cl-protobufs.git Allow import by symbol to support pure-lisp protobuf definitions --- diff --git a/asdf-support.lisp b/asdf-support.lisp index 4aa3dcf..cb1b158 100644 --- a/asdf-support.lisp +++ b/asdf-support.lisp @@ -233,14 +233,18 @@ ;; Process 'import' lines (defun process-imports (schema imports) - "Imports all of the files given by 'imports'. - If the file is a .proto file, it first parses it and writes a .lisp file. - The .lisp file is the compiled and loaded." + "Processes the imports for a schema. + If the import is a symbol, see if that resolves to an existing schema. + If the import is a file (string, pathname), parse it as a .proto in the usual manner." (dolist (import imports) - (let* ((proto-file (do-process-import (pathname import))) - (imported (find-schema proto-file))) - (when imported - (appendf (proto-imported-schemas schema) (list imported)))))) + (let ((imported-schema (find-schema + (etypecase import + ((or string pathname) + (do-process-import (pathname import))) + (symbol import))))) + (if imported-schema + (appendf (proto-imported-schemas schema) (list imported-schema)) + (error "Could not import ~S" import))))) (defun process-imports-from-file (imports-file) (when (probe-file imports-file)