annotate runtime/syntax/modula2.vim @ 17302:e0d727872758 v8.1.1650

patch 8.1.1650: warning for using uninitialized variable commit https://github.com/vim/vim/commit/ee9e604124682b0cd89e4f987a2f6f3fe4160920 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jul 8 20:08:44 2019 +0200 patch 8.1.1650: warning for using uninitialized variable Problem: Warning for using uninitialized variable. (Tony Mechelynck) Solution: Simplify the code by always using the mouse coordinates.
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Jul 2019 20:15:05 +0200
parents 46763b01cd9a
children ff27442e7851
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
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
7 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
8 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 " 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
13
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 " Especially emphasize headers of procedures and modules:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 syn region modula2Header matchgroup=modula2Header start="PROCEDURE " end="(" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 syn region modula2Header matchgroup=modula2Header start="MODULE " end=";" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 syn region modula2Header matchgroup=modula2Header start="BEGIN (\*" end="\*)" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 syn region modula2Header matchgroup=modula2Header start="END " end=";" contains=modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn region modula2Keyword start="END" end=";" contains=ALLBUT,modula2Ident oneline
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 " Some very important keywords which should be emphasized more than others:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 syn keyword modula2AttKeyword CONST EXIT HALT RETURN TYPE VAR
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 " All other keywords in alphabetical order:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword modula2Keyword AND ARRAY BY CASE DEFINITION DIV DO ELSE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword modula2Keyword ELSIF EXPORT FOR FROM IF IMPLEMENTATION IMPORT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword modula2Keyword IN LOOP MOD NOT OF OR POINTER QUALIFIED RECORD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword modula2Keyword SET THEN TO UNTIL WHILE WITH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword modula2Type ADDRESS BITSET BOOLEAN CARDINAL CHAR INTEGER REAL WORD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword modula2StdFunc ABS CAP CHR DEC EXCL INC INCL ORD SIZE TSIZE VAL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword modula2StdConst FALSE NIL TRUE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 " The following may be discussed, since NEW and DISPOSE are some kind of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " special builtin macro functions:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword modula2StdFunc NEW DISPOSE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 " The following types are added later on and may be missing from older
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 " Modula-2 Compilers (they are at least missing from the original report
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 " by N.Wirth from March 1980 ;-) Highlighting should apply nevertheless:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword modula2Type BYTE LONGCARD LONGINT LONGREAL PROC SHORTCARD SHORTINT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " same note applies to min and max, which were also added later to m2:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword modula2StdFunc MAX MIN
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 " The underscore was originally disallowed in m2 ids, it was also added later:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match modula2Ident " [A-Z,a-z][A-Z,a-z,0-9,_]*" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Comments may be nested in Modula-2:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region modula2Comment start="(\*" end="\*)" contains=modula2Comment,modula2Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword modula2Todo contained TODO FIXME XXX
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Strings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn region modula2String start=+"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 syn region modula2String start="'" end="'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn region modula2Set start="{" end="}"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
54 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
56 hi def link modula2Ident Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
57 hi def link modula2StdConst Boolean
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
58 hi def link modula2Type Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
59 hi def link modula2StdFunc Identifier
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
60 hi def link modula2Header Type
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
61 hi def link modula2Keyword Statement
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
62 hi def link modula2AttKeyword PreProc
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
63 hi def link modula2Comment Comment
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
64 " The following is just a matter of taste (you want to try this instead):
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 7
diff changeset
65 " hi modula2Comment term=bold ctermfg=DarkBlue guifg=Blue gui=bold
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
66 hi def link modula2Todo Todo
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
67 hi def link modula2String String
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
68 hi def link modula2Set String
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 let b:current_syntax = "modula2"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " vim: ts=8