diff --git a/wip-duuqnd/user-side-compiler/asm-function.lisp b/wip-duuqnd/user-side-compiler/asm-function.lisp index fdb39b1..51d601b 100644 --- a/wip-duuqnd/user-side-compiler/asm-function.lisp +++ b/wip-duuqnd/user-side-compiler/asm-function.lisp @@ -1,10 +1,14 @@ (in-package #:user-side-compiler) -;;; STUB, TODO +(defvar *asm-functions* (make-hash-table :test #'equalp)) (defclass asm-function () ((%name :accessor name :initarg :name))) (define-transformation (token (token-name asm-function)) - ;; TODO: Choose from a list, don't just create like this - (make-instance 'asm-function :name (name token))) + (multiple-value-bind (asm-function existsp) + (gethash (name token) *asm-functions*) + (if existsp + asm-function + (setf (gethash (name token) *asm-functions*) + (make-instance 'asm-function :name (name token))))))