Improve parser - generate prims from globals
[clnl] / src / main / model.lisp
index 1927ff5847f9740e8d393c6da4642dab87e0189e..33f90aa588327b040c5b87a02b1f85efb21223b5 100644 (file)
@@ -54,7 +54,15 @@ DESCRIPTION:
           (read-sections (append section (list line))))))))
      (read-sections))))
   (make-model
-   :code (clnl-code-parser:parse (clnl-lexer:lex (format nil "~{~A~^~%~}" (nth 0 sections))))
+   :code (clnl-code-parser:parse
+          (clnl-lexer:lex (format nil "~{~A~^~%~}" (nth 0 sections)))
+          (remove nil
+           (mapcar
+            (lambda (widget)
+             (typecase widget
+              (slider (intern (string-upcase (slider-varname widget)) (find-package :keyword)))
+              (switch (intern (string-upcase (switch-varname widget)) (find-package :keyword)))))
+            (parse-interface (nth 1 sections)))))
    :interface (parse-interface (nth 1 sections))
    :info (nth 2 sections)
    :turtle-shapes (nth 3 sections)