From 3838626bc64dec453ccfb4b9b74e87d0e5adb2b5 Mon Sep 17 00:00:00 2001 From: Ben Elliston Date: Wed, 21 Mar 2001 21:50:57 +0000 Subject: [PATCH] 2001-03-21 Ben Elliston * opc-itab.scm (compute-syntax): Emit a parse error if an operand given in a syntax string is undefined. --- ChangeLog | 3 +++ opc-itab.scm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index b4289b5..df24d3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2001-03-21 Ben Elliston + * opc-itab.scm (compute-syntax): Emit a parse error if an operand + given in a syntax string is undefined. + * opc-itab.scm (compute-syntax): Emit a parse error if an operand name is empty or invalid -- eg. "$(rs)" instead of "($rs)". diff --git a/opc-itab.scm b/opc-itab.scm index 03d347a..16f821b 100644 --- a/opc-itab.scm +++ b/opc-itab.scm @@ -164,6 +164,9 @@ (let ((n (id-len (string-drop1 syn)))) (if (= n 0) (parse-error context "empty or invalid operand name" syntax)) + (let ((operand (string->symbol (substring syn 1 (1+ n))))) + (if (not (current-op-lookup operand)) + (parse-error context "undefined operand " operand syntax))) (loop (string-drop (1+ n) syn) (string-append result op-macro " (" (string-upcase -- 2.43.5