*** empty log message ***

original commit: a82a3eb0a7ae8c28f8f80538c34f99cc08c39c93
tokens
Scott Owens 23 years ago
parent b05f4915a9
commit 30f960322a

@ -265,6 +265,15 @@
(syntax-case prod-so () (syntax-case prod-so ()
((prod-rhs-sym ...) ((prod-rhs-sym ...)
(andmap identifier? (syntax->list prod-so)) (andmap identifier? (syntax->list prod-so))
(begin
(for-each (lambda (t)
(if (memq (syntax-object->datum t) end-terms)
(raise-syntax-error
'parser-production-rhs
(format "~a is an end token and cannot be used in a production"
(syntax-object->datum t))
t)))
(syntax->list prod-so))
(list->vector (list->vector
(map (lambda (s) (map (lambda (s)
(hash-table-get (hash-table-get
@ -281,7 +290,7 @@
"~a is not declared as a terminal or non-terminal" "~a is not declared as a terminal or non-terminal"
(syntax-object->datum s)) (syntax-object->datum s))
s)))))) s))))))
(syntax->list prod-so)))) (syntax->list prod-so)))))
(_ (_
(raise-syntax-error (raise-syntax-error
'parser-production-rhs 'parser-production-rhs

Loading…
Cancel
Save