[m-rev.] diff: fix vim syntax file

Julien Fischer juliensf at students.cs.mu.OZ.AU
Fri Mar 12 14:09:10 AEDT 2004

Estimated hours taken: 0.1
Branches: main

Fix the syntax highlighting for vim so that it does
not attempt to highlight C comments inside strings.
Doing so results in code like the following being
incorrectly highlighted - (thanks to Ralph for fixing this).

	io.write_string("/*", !IO),
	io.write_string("foo", !IO),
	io.write_string("*/", !IO)

	Fix highlighting of strings that contain C comments.

	Highlight `tabled_for_io' as we do for other foreign
	code attributes.


Index: mercury.vim
RCS file: /home/mercury1/repository/mercury/vim/syntax/mercury.vim,v
retrieving revision 1.7
diff -u -r1.7 mercury.vim
--- mercury.vim	4 Nov 2003 05:04:08 -0000	1.7
+++ mercury.vim	12 Mar 2004 00:05:54 -0000
@@ -50,6 +50,7 @@
 syn keyword mercuryCInterface   may_call_mercury will_not_call_mercury
 syn keyword mercuryCInterface   thread_safe not_thread_safe
 syn keyword mercuryCInterface   promise_pure promise_semipure
+syn keyword mercuryCInterface   tabled_for_io
 syn keyword mercuryCInterface   export import
 syn keyword mercuryImpure       impure semipure
 syn keyword mercuryToDo         XXX TODO NOTE
@@ -57,7 +58,7 @@
 syn match   mercuryImplication  +<=>\|<=\|=>\|/\\\|\\/+
 syn match   mercuryNumCode      +0'.\|0[box][0-9a-fA-F]*+
 syn region  mercuryAtom         start=+'+ skip=+\\.+ end=+'+
-syn region  mercuryString       start=+"+ skip=+\\.+ end=+"+                              contains=mercuryStringFmt,mercuryCComment
+syn region  mercuryString       start=+"+ skip=+\\.+ end=+"+                              contains=mercuryStringFmt
 syn match   mercuryStringFmt    +\\[abfnrtv]\|\\x[0-9a-fA-F]*\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]+                                                                           contained
 syn region  mercuryClauseHead   start=+^[a-zA-Z]+ end=+=\|:-\|\.\s*$\|-->+                    contains=mercuryComment,mercuryCComment,mercuryAtom,mercuryString
 syn region  mercuryCComment     start=+/\*+ end=+\*/+                                         contains=mercuryToDo
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe

More information about the reviews mailing list