-
Notifications
You must be signed in to change notification settings - Fork 1
/
monkeyc.vim
42 lines (33 loc) · 1.18 KB
/
monkeyc.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
" Vim syntax file
" Language: monkeyc
" quit when a syntax file was already loaded
" if exists("b:current_syntax")
" finish
" endif
let s:cpo_save = &cpo
set cpo&vim
" A bunch of useful monkeyc keywords
syn keyword monkeycKeyword class extends module function
syn keyword monkeycKeyword using
syn keyword monkeycKeyword if else for while try catch return break continue
syn keyword monkeycKeyword hidden var const
syn match monkeycIdentifier "[a-zA-Z][a-zA-Z0-9_]*"
syn keyword monkeycTodo contained TODO
syn match monkeycNumber "\<\d\+\>"
syn region monkeycString start="\"" skip="\\\"" end="\""
syn match monkeycOperator "[=<>+/*-]"
syn region monkeycComment start="/\*" end="\*/" contains=monkeycTodo
syn region monkeycComment start="//" end="$" contains=monkeycTodo
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link monkeycNumber Number
hi def link monkeycKeyword Statement
hi def link monkeycString String
hi def link monkeycComment Comment
hi def link monkeycOperator Special
hi def link monkeycIdentifier Identifier
"hi def link monkeycTodo Todo
let b:current_syntax = "monkeyc"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8