From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3733 invoked by alias); 25 Apr 2002 15:06:09 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3231 invoked from network); 25 Apr 2002 15:04:48 -0000 Received: from unknown (HELO cerbere.u-strasbg.fr) (130.79.112.7) by sources.redhat.com with SMTP; 25 Apr 2002 15:04:48 -0000 Received: from laocoon (laocoon.u-strasbg.fr [130.79.112.72]) by cerbere.u-strasbg.fr (8.9.3/8.8.7) with ESMTP id RAA08001 for ; Thu, 25 Apr 2002 17:04:45 +0200 Message-Id: <4.2.0.58.20020425103344.024be7a8@ics.u-strasbg.fr> X-Sender: muller@ics.u-strasbg.fr Date: Thu, 25 Apr 2002 08:06:00 -0000 To: gdb-patches@sources.redhat.com From: Pierre Muller Subject: [PATCH]Use prev_lexptr in p-exp.y Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2002-04/txt/msg01014.txt.bz2 This basically just adds the same functionality than in the c language parser. See http://sources.redhat.com/ml/gdb-patches/2002-04/msg00467.html ChangeLog entry: 2002-04-25 Pierre Muller * p-exp.y: Also use new prev_lexptr variable to improve error reporting. Based on Michael Snyder 2002-04-24 dated patch to c-exp.y. Index: p-exp.y =================================================================== RCS file: /cvs/src/src/gdb/p-exp.y,v retrieving revision 1.9 diff -u -p -r1.9 p-exp.y --- p-exp.y 18 Apr 2002 15:22:18 -0000 1.9 +++ p-exp.y 25 Apr 2002 08:38:29 -0000 @@ -947,6 +947,8 @@ yylex () retry: + prev_lexptr = lexptr; + tokstart = lexptr; explen = strlen (lexptr); /* See if it is a special token of length 3. */ @@ -1481,5 +1483,8 @@ void yyerror (msg) char *msg; { + if (prev_lexptr) + lexptr = prev_lexptr; + error ("A %s in expression, near `%s'.", (msg ? msg : "error"), lexptr); } Pierre Muller Institut Charles Sadron 6,rue Boussingault F 67083 STRASBOURG CEDEX (France) mailto:muller@ics.u-strasbg.fr Phone : (33)-3-88-41-40-07 Fax : (33)-3-88-41-40-99