From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Feng Li Newsgroups: gmane.emacs.devel Subject: Re: Fixing a bug in pascal-mode Date: Sun, 6 Apr 2014 23:25:34 +0000 (UTC) Message-ID: References: <868urjncwl.fsf@gmail.com> <86ha66aggd.fsf@gmail.com> <53419083.4080901@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1396826775 7267 80.91.229.3 (6 Apr 2014 23:26:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Apr 2014 23:26:15 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 07 01:26:09 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WWwRz-0005hW-2x for ged-emacs-devel@m.gmane.org; Mon, 07 Apr 2014 01:26:07 +0200 Original-Received: from localhost ([::1]:59563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWwRy-00060K-Lg for ged-emacs-devel@m.gmane.org; Sun, 06 Apr 2014 19:26:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWwRp-0005sA-0K for emacs-devel@gnu.org; Sun, 06 Apr 2014 19:26:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWwRh-000270-DT for emacs-devel@gnu.org; Sun, 06 Apr 2014 19:25:56 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:46890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWwRh-00026u-78 for emacs-devel@gnu.org; Sun, 06 Apr 2014 19:25:49 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WWwRd-0005Oc-Eg for emacs-devel@gnu.org; Mon, 07 Apr 2014 01:25:46 +0200 Original-Received: from 203.111.191.138 ([203.111.191.138]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Apr 2014 01:25:45 +0200 Original-Received: from fengli by 203.111.191.138 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 07 Apr 2014 01:25:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 40 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 203.111.191.138 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:28.0) Gecko/20100101 Firefox/28.0) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171320 Archived-At: Daniel Colascione dancol.org> writes: > > On 04/06/2014 03:40 AM, Feng Li wrote: > > Feng Li gmail.com> writes: > > > >> Hi Emacs devs, > >> > >> I just fixed a small bug in pascal-mode. Here's the diff > >> > > Can you write a testcase? > > Hi Daniel, I'm not sure what kind of testcase do you want. I had a brief look in the source tree and didn't see any Pascal (or other languages) syntax highlighting testcases under the 'test' directory, which I could use as examples to write my testcases for these bugs. I could describe the nature of the 2 bugs though as they are really quite straightforward. So if you know how to write testcases probably you could help? The first bug actually prevents any syntax highlighting rules after it to run because that slot, if it's a list, then it should be a function rather than a font lock class. Emacs prints out errors like "function is void: font-lock-type-face" to the messages buffer. If there is any existing Pascal mode syntax highlighting testcases then most of them should already fail. The second bug is that in the syntax table the '_' character is considered a symbol delimiter but not a word delimiter. Therefore the regexps would match sub-strings inside a symbol. For example, the variable 'value_to_rgb' would have the 'to' matched as a keyword and the 'to' gets highlighted. Hopefully this helps. -- Feng Li