codekingpro/portable-devtools
114k
1" Vim syntax file2" Language: Elm3" Maintainer: Andreas Scharf <as@99n.de>4" Original Author: Joseph Hager <ajhager@gmail.com>5" Copyright: Joseph Hager <ajhager@gmail.com>6" License: BSD37" Latest Revision: 2020-05-298 9if exists('b:current_syntax')10 finish11endif12 13" Keywords14syn keyword elmConditional else if of then case15syn keyword elmAlias alias16syn keyword elmTypedef contained type port17syn keyword elmImport exposing as import module where18 19" Operators20" elm/core21syn match elmOperator contained "\(<|\||>\|||\|&&\|==\|/=\|<=\|>=\|++\|::\|+\|-\|*\|/\|//\|^\|<>\|>>\|<<\|<\|>\|%\)"22" elm/parser23syn match elmOperator contained "\(|.\||=\)"24" elm/url25syn match elmOperator contained "\(</>\|<?>\)"26 27" Types28syn match elmType "\<[A-Z][0-9A-Za-z_-]*"29syn keyword elmNumberType number30 31" Modules32syn match elmModule "\<\([A-Z][0-9A-Za-z_'-\.]*\)\+\.[A-Za-z]"me=e-233syn match elmModule "^\(module\|import\)\s\+[A-Z][0-9A-Za-z_'-\.]*\(\s\+as\s\+[A-Z][0-9A-Za-z_'-\.]*\)\?\(\s\+exposing\)\?" contains=elmImport34 35" Delimiters36syn match elmDelimiter "[,;]"37syn match elmBraces "[()[\]{}]"38 39" Functions40syn match elmTupleFunction "\((,\+)\)"41 42" Comments43syn keyword elmTodo TODO FIXME XXX contained44syn match elmLineComment "--.*" contains=elmTodo,@spell45syn region elmComment matchgroup=elmComment start="{-|\=" end="-}" contains=elmTodo,elmComment,@spell fold46 47" Strings48syn match elmStringEscape "\\u[0-9a-fA-F]\{4}" contained49syn match elmStringEscape "\\[nrfvbt\\\"]" contained50syn region elmString start="\"" skip="\\\"" end="\"" contains=elmStringEscape,@spell51syn region elmTripleString start="\"\"\"" skip="\\\"" end="\"\"\"" contains=elmStringEscape,@spell52syn match elmChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'"53 54" Lambda55syn region elmLambdaFunc start="\\"hs=s+1 end="->"he=e-256 57" Debug58syn match elmDebug "Debug.\(log\|todo\|toString\)"59 60" Numbers61syn match elmInt "-\?\<\d\+\>"62syn match elmFloat "-\?\(\<\d\+\.\d\+\>\)"63 64" Identifiers65syn match elmTopLevelDecl "^\s*[a-zA-Z][a-zA-z0-9_]*\('\)*\s\+:\(\r\n\|\r\|\n\|\s\)\+" contains=elmOperator66syn match elmFuncName /^\l\w*/67 68" Folding69syn region elmTopLevelTypedef start="type" end="\n\(\n\n\)\@=" contains=ALL fold70syn region elmTopLevelFunction start="^[a-zA-Z].\+\n[a-zA-Z].\+=" end="^\(\n\+\)\@=" contains=ALL fold71syn region elmCaseBlock matchgroup=elmCaseBlockDefinition start="^\z\(\s\+\)\<case\>" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\n\z1\@!\(\n\n\)\@=" contains=ALL fold72syn region elmCaseItemBlock start="^\z\(\s\+\).\+->$" end="^\z1\@!\W\@=" end="\(\n\n\z1\@!\)\@=" end="\(\n\z1\S\)\@=" contains=ALL fold73syn region elmLetBlock matchgroup=elmLetBlockDefinition start="\<let\>" end="\<in\>" contains=ALL fold74 75hi def link elmFuncName Function76hi def link elmCaseBlockDefinition Conditional77hi def link elmCaseBlockItemDefinition Conditional78hi def link elmLetBlockDefinition TypeDef79hi def link elmTopLevelDecl Function80hi def link elmTupleFunction Normal81hi def link elmTodo Todo82hi def link elmComment Comment83hi def link elmLineComment Comment84hi def link elmString String85hi def link elmTripleString String86hi def link elmChar String87hi def link elmStringEscape Special88hi def link elmInt Number89hi def link elmFloat Float90hi def link elmDelimiter Delimiter91hi def link elmBraces Delimiter92hi def link elmTypedef TypeDef93hi def link elmImport Include94hi def link elmConditional Conditional95hi def link elmAlias Delimiter96hi def link elmOperator Operator97hi def link elmType Type98hi def link elmNumberType Identifier99hi def link elmLambdaFunc Function100hi def link elmDebug Debug101hi def link elmModule Type102 103syn sync minlines=500104 105let b:current_syntax = 'elm'106 