From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: CC Mode - syntactical can of worms. Date: Thu, 31 Jan 2008 10:00:07 -0500 Message-ID: References: <20080131114546.GA2150@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1201791628 2963 80.91.229.12 (31 Jan 2008 15:00:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2008 15:00:28 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Thu Jan 31 16:00:48 2008 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by lo.gmane.org with esmtp (Exim 4.50) id 1JKauG-00008f-87 for sf-cc-mode-help@m.gmane.org; Thu, 31 Jan 2008 16:00:48 +0100 Original-Received: from sc8-sf-list1-new.sourceforge.net (sc8-sf-list1-new-b.sourceforge.net [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id B041C12AE9; Thu, 31 Jan 2008 07:00:20 -0800 (PST) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1JKatm-0003J9-Gc for cc-mode-help@lists.sourceforge.net; Thu, 31 Jan 2008 07:00:18 -0800 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1JKatj-0002YB-UP for cc-mode-help@lists.sourceforge.net; Thu, 31 Jan 2008 07:00:18 -0800 Original-Received: from mx10.gnu.org ([199.232.76.166]) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1JKatg-0007SR-P0 for bug-cc-mode@gnu.org; Thu, 31 Jan 2008 10:00:12 -0500 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1JKatd-00049d-UR for bug-cc-mode@gnu.org; Thu, 31 Jan 2008 10:00:12 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JKatd-00049X-LI; Thu, 31 Jan 2008 10:00:09 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAALZxoUfO+J95dGdsb2JhbACQIgEwgSGYKoEA X-IronPort-AV: E=Sophos;i="4.25,285,1199682000"; d="scan'208";a="13449041" Original-Received: from smtp.pppoe.ca ([65.39.196.238]) by ironport2-out.pppoe.ca with ESMTP; 31 Jan 2008 10:00:10 -0500 Original-Received: from pastel.home ([206.248.159.121]) by smtp.pppoe.ca (Internet Mail Server v1.0) with ESMTP id LQF70308; Thu, 31 Jan 2008 10:00:08 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id A5CED8123; Thu, 31 Jan 2008 10:00:07 -0500 (EST) In-Reply-To: <20080131114546.GA2150@muc.de> (Alan Mackenzie's message of "Thu, 31 Jan 2008 11:45:46 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 1.0 FORGED_RCVD_HELO Received: contains a forged HELO X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cc-mode-help-bounces@lists.sourceforge.net Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:5019 gmane.emacs.devel:87865 Archived-At: > Hi, Emacs and CC Mode! > Following up from: [orium69@gmail.com: Bug in emacs 22.1.1 (cosmetic > bug)]. > This bug was in C Mode, with the following source line: > #warning for isn't a keyword here. > This fouls up the fontification, because the syntactic fontification > recognises the apostrophe as a string opener. It can get pretty bad - > here is a syntactically correct C function: > 1 #warning for isn't a keyword here. ( > 2 //#warning for isnt a keyword here. > 3 void foo (bar) > 4 { > 5 #error Brace yourself! } > 6 printf ("Hello, world!\n") ; /* the famous one liner! */ > 7 } You forget other interesting constructs such as #define HELLO } #define WORLD ) void foo (WORLD { printf ("Hello\n"WORLD; HELLO and of course, the more common ones like #if foo void foo (void) { size_t toto; #else int foo () { unsigned toto; #endif or how 'bout #include "hello.h" void foo (WORLD { printf ("Hello\n"WORLD; HELLO CC-mode's job is fundamentally impossible. Stefan ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/