Skip to content

Commit

Permalink
Synced SML syntax file with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
mmottl committed Oct 22, 2021
1 parent 29d7851 commit 43c1c61
Showing 1 changed file with 53 additions and 68 deletions.
121 changes: 53 additions & 68 deletions .vim/syntax/sml.vim
Expand Up @@ -3,22 +3,17 @@
" Filenames: *.sml *.sig
" Maintainers: Markus Mottl <markus.mottl@gmail.com>
" Fabrizio Zeno Cornelli <zeno@filibusta.crema.unimi.it>
" URL: http://www.ocaml.info/vim/syntax/sml.vim
" Last Change: 2019 Oct 01 - Only spell check strings & comments (Chuanwei Foo)
" 2015 Aug 31 - Fixed opening of modules (Ramana Kumar)
" 2006 Oct 23 - Fixed character highlighting bug (MM)

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
" Disable spell checking of syntax.
syn spell notoplevel
" Last Change: 2021 Oct 04 - Fixed spell checking bug (Chuan Wei Foo)
" 2019 Oct 01 - Only spell check strings & comments (Chuan Wei Foo)

" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif

" Disable spell checking of syntax.
syn spell notoplevel

" SML is case sensitive.
syn case match

Expand Down Expand Up @@ -171,62 +166,52 @@ syn sync match smlSigSync grouphere smlSig "\<sig\>"
syn sync match smlSigSync groupthere smlSig "\<end\>"

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_sml_syntax_inits")
if version < 508
let did_sml_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif

HiLink smlBraceErr Error
HiLink smlBrackErr Error
HiLink smlParenErr Error

HiLink smlCommentErr Error

HiLink smlEndErr Error
HiLink smlThenErr Error

HiLink smlCharErr Error

HiLink smlComment Comment

HiLink smlModPath Include
HiLink smlModule Include
HiLink smlModParam1 Include
HiLink smlModType Include
HiLink smlMPRestr3 Include
HiLink smlFullMod Include
HiLink smlModTypeRestr Include
HiLink smlWith Include
HiLink smlMTDef Include

HiLink smlConstructor Constant

HiLink smlModPreRHS Keyword
HiLink smlMPRestr2 Keyword
HiLink smlKeyword Keyword
HiLink smlFunDef Keyword
HiLink smlRefAssign Keyword
HiLink smlKeyChar Keyword
HiLink smlAnyVar Keyword
HiLink smlTopStop Keyword
HiLink smlOperator Keyword

HiLink smlBoolean Boolean
HiLink smlCharacter Character
HiLink smlNumber Number
HiLink smlReal Float
HiLink smlString String
HiLink smlType Type
HiLink smlTodo Todo
HiLink smlEncl Keyword

delcommand HiLink
endif
" Only when an item doesn't have highlighting yet

hi def link smlBraceErr Error
hi def link smlBrackErr Error
hi def link smlParenErr Error

hi def link smlCommentErr Error

hi def link smlEndErr Error
hi def link smlThenErr Error

hi def link smlCharErr Error

hi def link smlComment Comment

hi def link smlModPath Include
hi def link smlModule Include
hi def link smlModParam1 Include
hi def link smlModType Include
hi def link smlMPRestr3 Include
hi def link smlFullMod Include
hi def link smlModTypeRestr Include
hi def link smlWith Include
hi def link smlMTDef Include

hi def link smlConstructor Constant

hi def link smlModPreRHS Keyword
hi def link smlMPRestr2 Keyword
hi def link smlKeyword Keyword
hi def link smlFunDef Keyword
hi def link smlRefAssign Keyword
hi def link smlKeyChar Keyword
hi def link smlAnyVar Keyword
hi def link smlTopStop Keyword
hi def link smlOperator Keyword

hi def link smlBoolean Boolean
hi def link smlCharacter Character
hi def link smlNumber Number
hi def link smlReal Float
hi def link smlString String
hi def link smlType Type
hi def link smlTodo Todo
hi def link smlEncl Keyword


let b:current_syntax = "sml"

Expand Down

0 comments on commit 43c1c61

Please sign in to comment.