Improve parser - generate some prims from breed statements
[clnl] / src / main / model.lisp
index 1927ff5847f9740e8d393c6da4642dab87e0189e..7a18fb0283adb3538e70104b9ec26f3f8d61061e 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)) :keyword))
+              (switch (intern (string-upcase (switch-varname widget)) :keyword))))
+            (parse-interface (nth 1 sections)))))
    :interface (parse-interface (nth 1 sections))
    :info (nth 2 sections)
    :turtle-shapes (nth 3 sections)