diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5bbb9c3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,11 @@ +Copyright Vanessa McHale (c) 2017 + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README b/README deleted file mode 100644 index 44c6c71..0000000 --- a/README +++ /dev/null @@ -1,5 +0,0 @@ -This is a mirror of http://www.vim.org/scripts/script.php?script_id=2693 - -A (rather incomplete) syntax highlighting for ATS (see http://www.ats-lang.org) - -Future improvements are planned. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7c38299 --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# ats-vim + +This provides detection and syntax highlighting for ATS programs. + +## Installation + +```vim +Plug 'vmchale/ats-vim' +``` diff --git a/ftdetect/ats.vim b/ftdetect/ats.vim new file mode 100644 index 0000000..2027153 --- /dev/null +++ b/ftdetect/ats.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead *.ats,*.dats*,*.cats,*.hats set filetype=ats diff --git a/syntax/ats.vim b/syntax/ats.vim index 9d8a1fa..0cb0d84 100644 --- a/syntax/ats.vim +++ b/syntax/ats.vim @@ -1,21 +1,3 @@ -" Vim syntax file -" Language: ATS -" Filenames: *.dats *.sats *.cats *.hats -" Maintainer: Artyom Shalkhakov -" Last Change: Jun 27, 2009 -" Version: 1 -" URL: http://artyoms.idhost.kz -" -" Huge thanks to maintainers of c.vim, haskell.vim, d.vim, -" html.vim. -" -" TODO: -" - make assignment of syntax groups more specific -" (see sml.vim for let/local/begin/etc.) -" - highlight viewt@ype, etc. as keywords -" - report errors on mismatching braces/parens/brackets -" - highlight @ as a StorageClass? - if !exists("main_syntax") if version < 600 syntax clear @@ -25,6 +7,8 @@ if !exists("main_syntax") let main_syntax = 'ats' endif +syn region atsIncludes start='#include' end='\v$' + " " lexical " @@ -125,6 +109,9 @@ syn region atsPreProc matchgroup=atsPreCondit start="^\s*\(%:\|#\)\s*\(pragma\> " don't use standard HiLink, it won't work with included syntax files command! -nargs=+ AtsHiLink hi def link +" includes +AtsHiLink atsIncludes Special + " comments AtsHiLink atsCommentStart atsComment AtsHiLink atsNestedComment Comment