bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stefan Monnier
Subject: bug#13585: pascal-mode doesn't recognize all free-pascal comments
Date: Wed, 30 Jan 2013 20:02:56 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> 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)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]