From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Berlin To: gdb-patches@sources.redhat.com Subject: [PATCH] Handle comments in the C expression parser Date: Tue, 13 Feb 2001 20:07:00 -0000 Message-id: X-SW-Source: 2001-02/msg00194.html This patch adds C-style comment handling to the expression parser. That way, we can add comments to output of various places, and still be able to paste it back in. (gdb) p 5 /* / */ / 3 $1 = 1 (gdb) p 5 /* / */ / 3 */* 333333 blah */ 2 $2 = 2 (gdb) p 5 /* / */ / 3 */* 333333 blah */ 2 $3 = 2 (gdb) p 5 /* / */ / 3 */* 333333 blah */ 2 $4 = 2 (gdb) p 5 /* / */ / 3 */* 333333 blah *// 2 A parse error in expression, near ` 2'. (gdb) p 5 /* / */ / 3 */* 333333 blah *// 2 A parse error in expression, near ` 2'. (gdb) p 5 /* / */ / 3 */* 333333 blah */2/ 2 $5 = 1 (gdb) (The parse errors are because, if you look closely, it's really 5 / 3 * / 2, so the parse error is correct. ) 2001-02-13 Daniel Berlin * c-exp.y : Handle C style comments in expression parser, ignoring them.