Subject: Re: bug#13585: pascal-mode doesn't recognize all free-pascal comments

From: Stefan Monnier <[email-masked]>
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)