From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12912 invoked by alias); 6 Aug 2009 16:49:45 -0000 Received: (qmail 12903 invoked by uid 22791); 6 Aug 2009 16:49:44 -0000 X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_00,DNS_FROM_RFC_BOGUSMX,J_CHICKENPOX_43,J_CHICKENPOX_73 X-Spam-Check-By: sourceware.org Received: from sebabeach.org (HELO sebabeach.org) (64.165.110.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Aug 2009 16:49:39 +0000 Received: by sebabeach.org (Postfix, from userid 500) id C68F06E3D1; Thu, 6 Aug 2009 09:49:37 -0700 (PDT) From: Doug Evans To: cgen@sourceware.org Subject: improvements in error reporting Message-Id: <20090806164937.C68F06E3D1@sebabeach.org> Date: Thu, 06 Aug 2009 16:49:00 -0000 X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00049.txt.bz2 Hi. fyi, I checked this in. It's a step in improving error messages. [plus some minor cleanup] More to follow .... 2009-08-05 Doug Evans Track source location better, for better error messages. * pmacros.scm (-pmacro-eval): Delete, unused. (pmacro-expand, -pmacro-expand): New arg `loc', all callers updated. (-pmacro-expand-expr-list, -smacro-apply): Ditto. (scan-list, scan): Ditto. (-pmacro-builtin-pmacro, -pmacro-builtin-let, -pmacro-builtin-if, -pmacro-builtin-case, -pmacro-builtin-cond, -pmacro-builtin-begin, -pmacro-builtin-andif, -pmacro-builtin-orif): Ditto. (scan-list1): New function. (-pmacro-build-lambda): New arg `loc', all callers updated. Rewrite. * read.scm (): New member `location'. (-reader-lookup-command): Renamed from reader-lookup-command, all callers updated. (reader-error): Rewrite to produce better source location info. (current-reader-location): New function. (-reader-process-expanded-1!): Renamed from -reader-process-expanded-1. All callers updated. Record source location of expression. (reader-process-expanded!): Renamed from reader-process-expanded. All callers updated. (-reader-process!): Renamed from reader-process. New arg `loc'. All callers updated. Record source location of define-pmacro. * utils-cgen.scm (): New class. (single-location): New (pseudo) class. (pretty-print-single-location, pretty-print-location): New functions. (location-top, location-push-single, location-push): New functions. (unspecified-location, current-input-location): New functions. (location-property): New object property. (location-property-set!): New function. (): Renamed from . New member `location'. All uses updated. * testsuite/location-1.test: New testcase. * testsuite/run-tests.sh: Fix fail count handling. * testsuite/test-utils.sh.in (run_cgen): New option `-f'. Allow tests to expect cgen to fail. * pmacros.scm (*): Use "pmacro" instead of "macro" more consistently. * read.scm (-cmd-include): Renamed from include. All callers updated. (-cmd-if): Renamed from cmd-if. All callers updated. Use reader-process-expanded! on then/else clauses instead of eval1.