From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Elliston To: cgen@sources.redhat.com Subject: [Patch] Emit error for undefined operands Date: Tue, 20 Mar 2001 23:11:00 -0000 Message-id: <15032.21527.993862.313213@scooby.apac.redhat.com> References: <15032.20928.840389.577266@scooby.apac.redhat.com> X-SW-Source: 2001-q1/msg00183.html >>>>> "Ben" == Ben Elliston writes: Ben> Here is another patch (precariously close to the last one!) which Ben> emits a parse error for undefined operands which appear in the syntax Ben> string. Okay to commit? Please disregard the last message on this subject. Here's a much cleaner version that utilises the function (current-op-lookup). Okay? 2001-03-21 Ben Elliston * opc-itab.scm (compute-syntax): Emit a parse error if an operand given in a syntax string is undefined. Index: opc-itab.scm =================================================================== RCS file: /cvs/cvsfiles/devo/cgen/opc-itab.scm,v retrieving revision 1.21 diff -u -c -r1.21 opc-itab.scm *** opc-itab.scm 2001/03/20 19:49:10 1.21 --- opc-itab.scm 2001/03/21 07:09:42 *************** *** 162,167 **** --- 162,172 ---- (substring syn 2 n))) "), "))))) (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