GNU bug report logs - #13585
pascal-mode doesn't recognize all free-pascal comments

Previous Next

Package: emacs;

Reported by: vrt277 <vrt277 <at> gmail.com>

Date: Tue, 29 Jan 2013 16:05:03 UTC

Severity: normal

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: vrt277 <vrt277 <at> gmail.com>
Cc: 13585 <at> debbugs.gnu.org
Subject: bug#13585: pascal-mode doesn't recognize all free-pascal comments
Date: Wed, 30 Jan 2013 20:02:56 -0500
> Nowday freepascal is one of most widely used pascal compilers (after
> Delphi).  Although delphi-mode doesn't have described problem I thiks
> if there is separate pascal-mode it should work good. So problem
> should be fixed.

Indeed, I even extended the syntax-table facility so as to be able to
properly support the many different comment styles in Pascal.

I installed the patch below, which should do what you asked for.

I hope someone can try and merge delphi.el and pascal.el.  It can be
done step by step, e.g. by first making delphi.el a derived mode of
pascal.el and then moving delphi.el code to pascal.el bit by bit.


        Stefan


=== modified file 'lisp/progmodes/pascal.el'
--- lisp/progmodes/pascal.el	2013-01-01 09:11:05 +0000
+++ lisp/progmodes/pascal.el	2013-01-31 00:56:19 +0000
@@ -138,6 +138,9 @@
     ;; find about the syntax of Pascal's comments said that (* ... } is
     ;; a valid comment, just as { ... *) or (* ... *) or { ... }.
     (modify-syntax-entry ?* ". 23" st)
+    ;; Allow //...\n comments as accepted by Free Pascal.
+    (modify-syntax-entry ?/ ". 12c" st)
+    (modify-syntax-entry ?\n "> c" st)
     (modify-syntax-entry ?{ "<"    st)
     (modify-syntax-entry ?} ">"    st)
     (modify-syntax-entry ?+ "."    st)





This bug report was last modified 12 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.