diff --git a/syntax/elm.vim b/syntax/elm.vim index be23595..270a803 100644 --- a/syntax/elm.vim +++ b/syntax/elm.vim @@ -8,7 +8,7 @@ endif syn keyword elmConditional else if of then syn keyword elmAlias alias syn keyword elmTypedef contained type port -syn keyword elmImport exposing as import module where +syn keyword elmImport contained exposing as import module where " Operators syn match elmOperator contained "\([-!#$%`&\*\+./<=>\?@\\^|~:]\|\<_\>\)" @@ -17,6 +17,10 @@ syn match elmOperator contained "\([-!#$%`&\*\+./<=>\?@\\^|~:]\|\<_\>\)" syn match elmType "\<[A-Z][0-9A-Za-z_'-]*" syn keyword elmNumberType number +" Modules +syn match elmModule "\<[A-Z][0-9A-Za-z_'-]*\."me=e-1 +syn match elmModule "^\(module\|import\)\s\+[A-Z][0-9A-Za-z_'-\.]*\(\s\+as\s\+[A-Z][0-9A-Za-z_'-\.]*\)\?\(\s\+exposing\)\?" contains=elmImport + " Delimiters syn match elmDelimiter "[,;]" syn match elmBraces "[()[\]{}]" @@ -73,6 +77,7 @@ hi def link elmAlias Delimiter hi def link elmOperator Operator hi def link elmType Identifier hi def link elmNumberType Identifier +hi def link elmModule Type syn sync minlines=500