aboutsummaryrefslogtreecommitdiff
path: root/vim-snug/syntax/snug.vim
blob: c75f7519ce737a8d63c7172d9eb2b8a1614a7b54 (plain) (blame)
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
43
" Snug syntax file
" Language:    Snug functional programing language
" Maintainer:  Camil Staps <info@camilstaps.nl>
" License:     This file is placed in the public domain.

if exists("b:current_syntax")
  finish
endif

let s:cpo_save = &cpo
set cpo&vim

syn keyword snugKeyword    case data fun type
syn keyword snugStatement  test

syn keyword snugTodo       TODO FIXME XXX BUG NB contained containedin=snugComment

syn match   snugChar       /'[^'\\]'/ display
syn match   snugInt        /\d\+/ display
syn region  snugString     start=+"+ end=+"+ oneline

syn match   snugDelimiter  /\v[\[\]\(\):;=,]/ display

syn match   snugIdentifier /^[_a-zA-Z]\+/ display

syn region  snugComment    start="(#" end="#)" contains=@Spell,snugComment display

hi def link snugKeyword    Keyword
hi def link snugStatement  Statement
hi def link snugChar       Character
hi def link snugInt        Number
hi def link snugString     String
hi def link snugDelimiter  Delimiter
hi def link snugIdentifier Identifier
hi def link snugTodo       Todo
hi def link snugComment    Comment

syntax sync ccomment snugComment

let b:current_syntax = 'snug'

let &cpo = s:cpo_save
unlet s:cpo_save