-(in-package #:cl-nl.parser)
+(in-package #:clnl-parser)
; Ok, after thinking about this a little, the parser is completely contextual
; based on what has come before. We can't do a contextless parsing, like we
(prim-name prim)
(mapcar
#'help-arg
- (prim-args prim)
+ (prim-args prim)
(butlast parsed-remainder (- (length parsed-remainder) num-args))))
(nthcdr num-args parsed-remainder))))
(t (error "Couldn't parse ~S" lexed-ast))))
(case arg-type
(:command-block
(if (not (and (consp arg) (eql 'block (car arg))))
- (error "Required a block, but found a ~A" arg)
- (cons :command-block (cdr arg))))
+ (error "Required a block, but found a ~A" arg)
+ (cons :command-block (cdr arg))))
(t arg)))
(defun parse-block (tokens)
; This list of prims will get combined with the mapping to actual code later
; Current list of argument types we accept:
; - :number
+; - :agentset
+; - :command-block
; - t - any type
(defprim :ask (:agentset :command-block))
(defprim :crt (:number))
(defprim :fd (:number))
+(defprim :random-float (:number))
(defprim :show (t))
(defprim :turtles ())