annotate runtime/syntax/clean.vim @ 4916:ba328b4a990e v7.3.1203

updated for version 7.3.1203 Problem: Matches from matchadd() might be highlighted incorrectly when they are at a fixed position and inserting lines. (John Szakmeister) Solution: Redraw all lines below a change if there are highlighted matches. (idea by Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Sat, 15 Jun 2013 23:00:30 +0200
parents cf1d93a3914a
children ceb5f21cda79
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: Clean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Author: Pieter van Engelen <pietere@sci.kun.nl>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Co-Author: Arthur van Leeuwen <arthurvl@sci.kun.nl>
4358
cf1d93a3914a Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
5 " Previous Change: 2011 Dec 25 by Thilo Six
cf1d93a3914a Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
6 " Last Change: 2013 Apr 25 by Jurriƫn Stutterheim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
16 let s:cpo_save = &cpo
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
17 set cpo&vim
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
18
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " Some Clean-keywords
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 syn keyword cleanConditional if case
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 syn keyword cleanLabel let! with where in of
4358
cf1d93a3914a Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 3237
diff changeset
22 syn keyword cleanInclude from import qualified
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 syn keyword cleanSpecial Start
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn keyword cleanKeyword infixl infixr infix
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 syn keyword cleanBasicType Int Real Char Bool String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword cleanSpecialType World ProcId Void Files File
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword cleanModuleSystem module implementation definition system
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword cleanTypeClass class instance export
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " To do some Denotation Highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword cleanBoolDenot True False
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn region cleanStringDenot start=+"+ end=+"+
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 syn match cleanCharDenot "'.'"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn match cleanCharsDenot "'[^'\\]*\(\\.[^'\\]\)*'" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn match cleanIntegerDenot "[+-~]\=\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn match cleanRealDenot "[+-~]\=\<\d\+\.\d+\(E[+-~]\=\d+\)\="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 " To highlight the use of lists, tuples and arrays
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 syn region cleanList start="\[" end="\]" contains=ALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn region cleanRecord start="{" end="}" contains=ALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 syn region cleanArray start="{:" end=":}" contains=ALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match cleanTuple "([^=]*,[^=]*)" contains=ALL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " To do some Comment Highlighting
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn region cleanComment start="/\*" end="\*/" contains=cleanComment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match cleanComment "//.*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 " Now for some useful typedefinitionrecognition
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)[ \t]*\(infix[lr]\=\)\=[ \t]*\d\=[ \t]*::.*->.*" contains=cleanSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " 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
54 if version >= 508 || !exists("did_clean_syntax_init")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 let did_clean_syntax_init = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 " Comments
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 HiLink cleanComment Comment
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 " Constants and denotations
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 HiLink cleanCharsDenot String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 HiLink cleanStringDenot String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 HiLink cleanCharDenot Character
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink cleanIntegerDenot Number
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink cleanBoolDenot Boolean
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 HiLink cleanRealDenot Float
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " Identifiers
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " Statements
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink cleanTypeClass Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink cleanConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink cleanLabel Label
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink cleanKeyword Keyword
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 " Generic Preprocessing
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 HiLink cleanInclude Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 HiLink cleanModuleSystem PreProc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 " Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 HiLink cleanBasicType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 HiLink cleanSpecialType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 HiLink cleanFuncTypeDef Typedef
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 " Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 HiLink cleanSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 HiLink cleanList Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 HiLink cleanArray Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 HiLink cleanRecord Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 HiLink cleanTuple Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 " Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 " Todo
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 let b:current_syntax = "clean"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3237
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
98 let &cpo = s:cpo_save
91e53bcb7946 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 7
diff changeset
99 unlet s:cpo_save
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 " vim: ts=4