Store ASM-FUNCTIONs in a hash table keyed on name
TODO: Populate the table based on the asm source code declaration comments and signal an error when a named function is missing.
This commit is contained in:
parent
094f01d258
commit
3b8c906d75
1 changed files with 7 additions and 3 deletions
|
@ -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))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue