From 2a622c0cf380a4fe5bb7fd039616099b8a56459d Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 29 Oct 2009 15:43:50 +0000 Subject: [PATCH] added error checking svn: r16448 original commit: 2f47a882c955baa3111d3685af8c7cf10d364483 --- collects/parser-tools/yacc.ss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/collects/parser-tools/yacc.ss b/collects/parser-tools/yacc.ss index 296e027..09ba0c9 100644 --- a/collects/parser-tools/yacc.ss +++ b/collects/parser-tools/yacc.ss @@ -320,6 +320,9 @@ (define (make-parser start-number) (lambda (get-token) + (unless (and (procedure? get-token) + (procedure-arity-includes? get-token 0)) + (error 'get-token "expected a nullary procedure, got ~e" get-token)) (let parsing-loop ((stack (make-empty-stack start-number)) (ip (get-token))) (let-values (((tok val start-pos end-pos)