annotate runtime/syntax/modula2.vim @ 8839:9fa567d13551 v7.4.1707

commit https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Apr 3 22:44:36 2016 +0200 patch 7.4.1707 Problem: Cannot use empty dictionary key, even though it can be useful. Solution: Allow using an empty dictionary key.
author Christian Brabandt <cb@256bit.org>
date Sun, 03 Apr 2016 22:45:05 +0200
parents 3fc0f57ecb91
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Modula 2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: pf@artcom0.north.de (Peter Funk)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " based on original work of Bram Moolenaar <Bram@vim.org>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Last Change: 2001 May 09
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 " Don't ignore case (Modula-2 is case significant). This is the default in vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 " Especially emphasize headers of procedures and modules:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn region modula2Header matchgroup=modula2Header start="PROCEDURE " end="(" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn region modula2Header matchgroup=modula2Header start="MODULE " end=";" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn region modula2Header matchgroup=modula2Header start="BEGIN (\*" end="\*)" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn region modula2Header matchgroup=modula2Header start="END " end=";" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn region modula2Keyword start="END" end=";" contains=ALLBUT,modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 " Some very important keywords which should be emphasized more than others:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword modula2AttKeyword CONST EXIT HALT RETURN TYPE VAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 " All other keywords in alphabetical order:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword modula2Keyword AND ARRAY BY CASE DEFINITION DIV DO ELSE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword modula2Keyword ELSIF EXPORT FOR FROM IF IMPLEMENTATION IMPORT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword modula2Keyword IN LOOP MOD NOT OF OR POINTER QUALIFIED RECORD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword modula2Keyword SET THEN TO UNTIL WHILE WITH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword modula2Type ADDRESS BITSET BOOLEAN CARDINAL CHAR INTEGER REAL WORD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn keyword modula2StdFunc ABS CAP CHR DEC EXCL INC INCL ORD SIZE TSIZE VAL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword modula2StdConst FALSE NIL TRUE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " The following may be discussed, since NEW and DISPOSE are some kind of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " special builtin macro functions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword modula2StdFunc NEW DISPOSE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " The following types are added later on and may be missing from older
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Modula-2 Compilers (they are at least missing from the original report
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 " by N.Wirth from March 1980 ;-) Highlighting should apply nevertheless:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn keyword modula2Type BYTE LONGCARD LONGINT LONGREAL PROC SHORTCARD SHORTINT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 " same note applies to min and max, which were also added later to m2:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword modula2StdFunc MAX MIN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " The underscore was originally disallowed in m2 ids, it was also added later:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match modula2Ident " [A-Z,a-z][A-Z,a-z,0-9,_]*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 " Comments may be nested in Modula-2:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn region modula2Comment start="(\*" end="\*)" contains=modula2Comment,modula2Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword modula2Todo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Strings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn region modula2String start=+"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn region modula2String start="'" end="'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn region modula2Set start="{" end="}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 if version >= 508 || !exists("did_modula2_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 let did_modula2_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink modula2Ident Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink modula2StdConst Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink modula2Type Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink modula2StdFunc Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 HiLink modula2Header Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 HiLink modula2Keyword Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink modula2AttKeyword PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink modula2Comment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " The following is just a matter of taste (you want to try this instead):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 " hi modula2Comment term=bold ctermfg=DarkBlue guifg=Blue gui=bold
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 HiLink modula2Todo Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink modula2String String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink modula2Set String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 let b:current_syntax = "modula2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " vim: ts=8