This commit is contained in:
sup39 2022-02-22 12:14:04 +09:00
commit 09729362e7
4 changed files with 82 additions and 0 deletions

22
LICENSE Normal file
View file

@ -0,0 +1,22 @@
Copyright (c) 2022 sup39[サポミク]
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

12
README.md Normal file
View file

@ -0,0 +1,12 @@
# sunscript.vim
Vim syntax highlight for SunScript.
## Installation
If you are using [vim-plug](https://github.com/junegunn/vim-plug/),
add the following line between
`call plug#begin('~/.vim/plugged')` and `call plug#end()`:
```vim
Plug 'sup39/sunscript.vim'
```
Then `:source $MYVIMRC` and `:PlugInstall` to install this plug.

1
ftdetect/sunscript.vim Normal file
View file

@ -0,0 +1 @@
autocmd BufNewFile,BufRead *.sun setfiletype sunscript

47
syntax/sunscript.vim Normal file
View file

@ -0,0 +1,47 @@
if exists("b:current_syntax")
finish
endif
" literal-keyword
"" loop
syn keyword sunKeyword break continue return
"" flow
syn keyword sunKeyword yield exit block unlock
"" storage
syn keyword sunKeyword const var local
" import
syn keyword sunKeyword import
" CONDITIONALS
syn keyword sunKeyword do while for else if
" function
syn keyword sunKeyword function builtin
" comment
syn region sunComment start='\V/*' end='\V*/'
syn match sunComment '//.*'
" literal
"" address
syn match sunNumber '\v\$[0-9A-Fa-f]{8}>'
"" hexadecimal
syn match sunNumber '\v<0x[0-9A-Fa-f]+>'
"" integer
syn match sunNumber '\v<[0-9]+>'
"" decimal
syn match sunNumber '\v<[0-9]+\.[0-9]+>'
"" string
syn match sunString '\v"%([^"\\]|\\%(\'\'|["\\0abfnrtv]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}))*"'
"" bool
syn keyword sunBoolean true false
"""" hi
hi link sunKeyword Keyword
hi link sunComment Comment
hi link sunNumber Number
hi link sunString String
hi link sunBoolean Boolean
let b:current_syntax = 'sunscript'