neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

clean.vim (3151B)


      1 " Vim syntax file
      2 " Language:		Clean
      3 " Author:		Pieter van Engelen <pietere@sci.kun.nl>
      4 " Co-Author:	Arthur van Leeuwen <arthurvl@sci.kun.nl>
      5 " Last Change:	2013 Oct 15 by Jurriƫn Stutterheim
      6 
      7 " quit when a syntax file was already loaded
      8 if exists("b:current_syntax")
      9  finish
     10 endif
     11 
     12 let s:cpo_save = &cpo
     13 set cpo&vim
     14 
     15 " Some Clean-keywords
     16 syn keyword cleanConditional if case
     17 syn keyword cleanLabel let! with where in of
     18 syn keyword cleanSpecial Start
     19 syn keyword cleanKeyword infixl infixr infix
     20 syn keyword cleanBasicType Int Real Char Bool String
     21 syn keyword cleanSpecialType World ProcId Void Files File
     22 syn keyword cleanModuleSystem module implementation definition system
     23 syn keyword cleanTypeClass class instance export
     24 
     25 " Import highlighting
     26 syn region cleanIncludeRegion start="^\s*\(from\|import\|\s\+\(as\|qualified\)\)" end="\n" contains=cleanIncludeKeyword keepend
     27 syn keyword cleanIncludeKeyword contained from import as qualified
     28 
     29 " To do some Denotation Highlighting
     30 syn keyword cleanBoolDenot True False
     31 syn region cleanStringDenot start=+"+ skip=+\(\(\\\\\)\+\|\\"\)+ end=+"+ display
     32 syn match cleanCharDenot "'\(\\\\\|\\'\|[^'\\]\)\+'" display
     33 syn match cleanIntegerDenot "[\~+-]\?\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>" display
     34 syn match cleanRealDenot "[\~+-]\?\d\+\.\d\+\(E[\~+-]\?\d\+\)\?" display
     35 
     36 " To highlight the use of lists, tuples and arrays
     37 syn region cleanList start="\[" end="\]" contains=ALL
     38 syn region cleanRecord start="{" end="}" contains=ALL
     39 syn region cleanArray start="{:" end=":}" contains=ALL
     40 syn match cleanTuple "([^=]*,[^=]*)" contains=ALL
     41 
     42 " To do some Comment Highlighting
     43 syn region cleanComment start="/\*"  end="\*/" contains=cleanComment,cleanTodo fold
     44 syn region cleanComment start="//.*" end="$" display contains=cleanTodo
     45 syn keyword cleanTodo TODO FIXME XXX contained
     46 
     47 " Now for some useful type definition recognition
     48 syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)\s*\(infix[lr]\=\)\=\s*\d\=\s*::.*->.*" contains=cleanSpecial,cleanBasicType,cleanSpecialType,cleanKeyword
     49 
     50 
     51 " Define the default highlighting.
     52 " Only when an item doesn't have highlighting yet
     53 
     54 " Comments
     55 hi def link cleanComment      Comment
     56 " Constants and denotations
     57 hi def link cleanStringDenot  String
     58 hi def link cleanCharDenot    Character
     59 hi def link cleanIntegerDenot Number
     60 hi def link cleanBoolDenot    Boolean
     61 hi def link cleanRealDenot    Float
     62 " Identifiers
     63 " Statements
     64 hi def link cleanTypeClass    Keyword
     65 hi def link cleanConditional  Conditional
     66 hi def link cleanLabel		Label
     67 hi def link cleanKeyword      Keyword
     68 " Generic Preprocessing
     69 hi def link cleanIncludeKeyword      Include
     70 hi def link cleanModuleSystem PreProc
     71 " Type
     72 hi def link cleanBasicType    Type
     73 hi def link cleanSpecialType  Type
     74 hi def link cleanFuncTypeDef  Typedef
     75 " Special
     76 hi def link cleanSpecial      Special
     77 hi def link cleanList			Special
     78 hi def link cleanArray		Special
     79 hi def link cleanRecord		Special
     80 hi def link cleanTuple		Special
     81 " Error
     82 " Todo
     83 hi def link cleanTodo         Todo
     84 
     85 
     86 let b:current_syntax = "clean"
     87 
     88 let &cpo = s:cpo_save
     89 unlet s:cpo_save
     90 " vim: ts=4