Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
clean.vim91 linesDownload Raw Back to syntax
1" Vim syntax file2" Language:		Clean3" 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 Stutterheim6 7" quit when a syntax file was already loaded8if exists("b:current_syntax")9  finish10endif11 12let s:cpo_save = &cpo13set cpo&vim14 15" Some Clean-keywords16syn keyword cleanConditional if case17syn keyword cleanLabel let! with where in of18syn keyword cleanSpecial Start19syn keyword cleanKeyword infixl infixr infix20syn keyword cleanBasicType Int Real Char Bool String21syn keyword cleanSpecialType World ProcId Void Files File22syn keyword cleanModuleSystem module implementation definition system23syn keyword cleanTypeClass class instance export24 25" Import highlighting26syn region cleanIncludeRegion start="^\s*\(from\|import\|\s\+\(as\|qualified\)\)" end="\n" contains=cleanIncludeKeyword keepend27syn keyword cleanIncludeKeyword contained from import as qualified28 29" To do some Denotation Highlighting30syn keyword cleanBoolDenot True False31syn region cleanStringDenot start=+"+ skip=+\(\(\\\\\)\+\|\\"\)+ end=+"+ display32syn match cleanCharDenot "'\(\\\\\|\\'\|[^'\\]\)\+'" display33syn match cleanIntegerDenot "[\~+-]\?\<\(\d\+\|0[0-7]\+\|0x[0-9A-Fa-f]\+\)\>" display34syn match cleanRealDenot "[\~+-]\?\d\+\.\d\+\(E[\~+-]\?\d\+\)\?" display35 36" To highlight the use of lists, tuples and arrays37syn region cleanList start="\[" end="\]" contains=ALL38syn region cleanRecord start="{" end="}" contains=ALL39syn region cleanArray start="{:" end=":}" contains=ALL40syn match cleanTuple "([^=]*,[^=]*)" contains=ALL41 42" To do some Comment Highlighting43syn region cleanComment start="/\*"  end="\*/" contains=cleanComment,cleanTodo fold44syn region cleanComment start="//.*" end="$" display contains=cleanTodo45syn keyword cleanTodo TODO FIXME XXX contained46 47" Now for some useful type definition recognition48syn match cleanFuncTypeDef "\([a-zA-Z].*\|(\=[-~@#$%^?!+*<>\/|&=:]\+)\=\)\s*\(infix[lr]\=\)\=\s*\d\=\s*::.*->.*" contains=cleanSpecial,cleanBasicType,cleanSpecialType,cleanKeyword49 50 51" Define the default highlighting.52" Only when an item doesn't have highlighting yet53 54 " Comments55 hi def link cleanComment      Comment56 " Constants and denotations57 hi def link cleanStringDenot  String58 hi def link cleanCharDenot    Character59 hi def link cleanIntegerDenot Number60 hi def link cleanBoolDenot    Boolean61 hi def link cleanRealDenot    Float62 " Identifiers63 " Statements64 hi def link cleanTypeClass    Keyword65 hi def link cleanConditional  Conditional66 hi def link cleanLabel		Label67 hi def link cleanKeyword      Keyword68 " Generic Preprocessing69 hi def link cleanIncludeKeyword      Include70 hi def link cleanModuleSystem PreProc71 " Type72 hi def link cleanBasicType    Type73 hi def link cleanSpecialType  Type74 hi def link cleanFuncTypeDef  Typedef75 " Special76 hi def link cleanSpecial      Special77 hi def link cleanList			Special78 hi def link cleanArray		Special79 hi def link cleanRecord		Special80 hi def link cleanTuple		Special81 " Error82 " Todo83 hi def link cleanTodo         Todo84 85 86let b:current_syntax = "clean"87 88let &cpo = s:cpo_save89unlet s:cpo_save90" vim: ts=491 
codekingpro/portable-devtools · Team Ai