1
0
mirror of https://github.com/dperelman/stonescript-vim synced 2025-04-23 14:08:12 -04:00

Initial draft of Stonescript syntax support. Keyword list incomplete.

This commit is contained in:
Daniel Perelman 2019-09-08 13:13:20 -07:00
parent ed5ad0a524
commit 622000e97e
2 changed files with 64 additions and 0 deletions

3
filetype.vim Normal file
View File

@ -0,0 +1,3 @@
augroup filetypedetect
au BufNewFile,BufRead *.stonescript setf stonescript
augroup END

61
syntax/stonescript.vim Normal file
View File

@ -0,0 +1,61 @@
" Vim syntax file
" Language: Stonescript (Stone Story RPG's builtin scripting language)
" Maintainer: Daniel Perelman (https://github.com/dperelman)
" Quit when a (custom) syntax file was already loaded
if exists('b:current_syntax')
finish
endif
syn match ssUnknown '\S*'
syn match ssComment '//.*'
syn keyword ssStatement equip equipL equipR loadout
syn match ssStatement 'activate potion'
syn match ssIf '?'
syn match ssBoolOperator '[!&|]'
syn match ssCompOperator '[><=]'
syn match ssNumber '\<\d\+\>'
syn match ssEnchantLvl '[+]\(\d\|1[0-6]\)\>'
syn match ssStarLvl '[*]\(\d\|10\)\>'
syn keyword ssLocation nagaraj rocky cave caves deadwood halls
syn keyword ssElement fire ice aether vigor poison
syn keyword ssItemKind sword shield crossbow rune wand hammer staff
\ ouroboros shovel hatchet grap
syn keyword ssItemModifier big repeating dashing
syn match ssItemVariant '\<[DdAa]\?[FfIiPpHLU]\?\>'
syn keyword ssFoeName morel serpent bolesh
syn keyword ssFoeProperty boss ranged magic_resist
\ immune_to_range immune_to_physical
syn match ssFoeVar 'foe\(.\(hp\|count\|armor\|distance\)\)\?'
syn match ssSelfVar '\(hp\|maxhp\|armor\|loc\|time\)'
hi def link ssComment Comment
hi def link ssStatement Statement
hi def link ssIf Conditional
hi def link ssLocation Constant
hi def link ssElement Type
hi def link ssItemKind Type
hi def link ssItemModifier Type
hi def link ssFoeName Constant
hi def link ssFoeProperty Constant
hi def link ssFoeVar Identifier
hi def link ssSelfVar Identifier
hi def link ssBoolOperator Operator
hi def link ssCompOperator Operator
hi def link ssNumber Number
hi def link ssEnchantLvl Type
hi def link ssStarLvl Type
hi def link ssItemVariant Type
hi def link ssUnknown Error
let b:current_syntax = 'stonescript'