| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							|  |  |  | " Language:		Clean | 
					
						
							|  |  |  | " Author:		Pieter van Engelen <pietere@sci.kun.nl> | 
					
						
							|  |  |  | " Co-Author:	Arthur van Leeuwen <arthurvl@sci.kun.nl> | 
					
						
							| 
									
										
										
										
											2013-11-03 21:14:31 +01:00
										 |  |  | " Last Change:	2013 Oct 15 by Jurriën Stutterheim | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " quit when a syntax file was already loaded | 
					
						
							|  |  |  | if exists("b:current_syntax") | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-30 13:11:27 +01:00
										 |  |  | let s:cpo_save = &cpo | 
					
						
							|  |  |  | set cpo&vim | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Some Clean-keywords | 
					
						
							|  |  |  | syn keyword cleanConditional if case | 
					
						
							|  |  |  | syn keyword cleanLabel let! with where in of | 
					
						
							|  |  |  | syn keyword cleanSpecial Start | 
					
						
							|  |  |  | syn keyword cleanKeyword infixl infixr infix | 
					
						
							|  |  |  | syn keyword cleanBasicType Int Real Char Bool String | 
					
						
							|  |  |  | syn keyword cleanSpecialType World ProcId Void Files File | 
					
						
							|  |  |  | syn keyword cleanModuleSystem module implementation definition system | 
					
						
							|  |  |  | syn keyword cleanTypeClass class instance export | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-24 22:22:18 +02:00
										 |  |  | " Import highlighting | 
					
						
							|  |  |  | syn region cleanIncludeRegion start="^\s*\(from\|import\|\s\+\(as\|qualified\)\)" end="\n" contains=cleanIncludeKeyword keepend | 
					
						
							|  |  |  | syn keyword cleanIncludeKeyword contained from import as qualified | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " To do some Denotation Highlighting | 
					
						
							|  |  |  | syn keyword cleanBoolDenot True False | 
					
						
							| 
									
										
										
										
											2013-11-03 21:14:31 +01:00
										 |  |  | syn region cleanStringDenot start=+"+ skip=+\(\(\\\\\)\+\|\\"\)+ end=+"+ display | 
					
						
							|  |  |  | syn match cleanCharDenot "'\(\\\\\|\\'\|[^'\\]\)\+'" display | 
					
						
							|  |  |  | syn match cleanIntegerDenot "[\~+-]\?\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>" display | 
					
						
							|  |  |  | syn match cleanRealDenot "[\~+-]\?\d\+\.\d\+\(E[\~+-]\?\d\+\)\?" display | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " To highlight the use of lists, tuples and arrays | 
					
						
							|  |  |  | syn region cleanList start="\[" end="\]" contains=ALL | 
					
						
							|  |  |  | syn region cleanRecord start="{" end="}" contains=ALL | 
					
						
							|  |  |  | syn region cleanArray start="{:" end=":}" contains=ALL | 
					
						
							|  |  |  | syn match cleanTuple "([^=]*,[^=]*)" contains=ALL | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " To do some Comment Highlighting | 
					
						
							| 
									
										
										
										
											2013-11-03 21:14:31 +01:00
										 |  |  | syn region cleanComment start="/\*"  end="\*/" contains=cleanComment,cleanTodo fold | 
					
						
							|  |  |  | syn region cleanComment start="//.*" end="$" display contains=cleanTodo | 
					
						
							|  |  |  | syn keyword cleanTodo TODO FIXME XXX contained | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Now for some useful type definition recognition | 
					
						
							|  |  |  | syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)\s*\(infix[lr]\=\)\=\s*\d\=\s*::.*->.*" contains=cleanSpecial,cleanBasicType,cleanSpecialType,cleanKeyword | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Define the default highlighting. | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  | " Only when an item doesn't have highlighting yet | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Comments | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanComment      Comment | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Constants and denotations | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanStringDenot  String | 
					
						
							|  |  |  |  hi def link cleanCharDenot    Character | 
					
						
							|  |  |  |  hi def link cleanIntegerDenot Number | 
					
						
							|  |  |  |  hi def link cleanBoolDenot    Boolean | 
					
						
							|  |  |  |  hi def link cleanRealDenot    Float | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Identifiers | 
					
						
							|  |  |  |  " Statements | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanTypeClass    Keyword | 
					
						
							|  |  |  |  hi def link cleanConditional  Conditional | 
					
						
							|  |  |  |  hi def link cleanLabel		Label | 
					
						
							|  |  |  |  hi def link cleanKeyword      Keyword | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Generic Preprocessing | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanIncludeKeyword      Include | 
					
						
							|  |  |  |  hi def link cleanModuleSystem PreProc | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Type | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanBasicType    Type | 
					
						
							|  |  |  |  hi def link cleanSpecialType  Type | 
					
						
							|  |  |  |  hi def link cleanFuncTypeDef  Typedef | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Special | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanSpecial      Special | 
					
						
							|  |  |  |  hi def link cleanList			Special | 
					
						
							|  |  |  |  hi def link cleanArray		Special | 
					
						
							|  |  |  |  hi def link cleanRecord		Special | 
					
						
							|  |  |  |  hi def link cleanTuple		Special | 
					
						
							| 
									
										
										
										
											2016-08-30 23:26:57 +02:00
										 |  |  |  " Error | 
					
						
							|  |  |  |  " Todo | 
					
						
							| 
									
										
										
										
											2016-08-31 22:22:10 +02:00
										 |  |  |  hi def link cleanTodo         Todo | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "clean" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-30 13:11:27 +01:00
										 |  |  | let &cpo = s:cpo_save | 
					
						
							|  |  |  | unlet s:cpo_save | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " vim: ts=4 |