annotate runtime/syntax/chaiscript.vim @ 6978:5ad1ff809c32

Added tag v7-4-806 for changeset b10995a2f7c3
author Bram Moolenaar <bram@vim.org>
date Tue, 04 Aug 2015 18:23:22 +0200
parents b9e314fe473f
children d46f974fd69e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2152
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
1 " Vim syntax file
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
2 " Language: ChaiScript
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
3 " Maintainer: Jason Turner <lefticus 'at' gmail com>
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
4
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
5 " Quit when a (custom) syntax file was already loaded
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
6 if exists("b:current_syntax")
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
7 finish
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
8 end
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
9
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
10 syn case match
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
11
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
12 " syncing method
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
13 syn sync fromstart
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
14
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
15 " Strings
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
16 syn region chaiscriptString start=+"+ end=+"+ skip=+\\\\\|\\"+ contains=chaiscriptSpecial,chaiscriptEval,@Spell
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
17
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
18 " Escape characters
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
19 syn match chaiscriptSpecial contained "\\[\\abfnrtv\'\"]\|\\\d\{,3}"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
20
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
21 " String evals
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
22 syn region chaiscriptEval contained start="${" end="}"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
23
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
24 " integer number
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
25 syn match chaiscriptNumber "\<\d\+\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
26
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
27 " floating point number, with dot, optional exponent
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
28 syn match chaiscriptFloat "\<\d\+\.\d*\%(e[-+]\=\d\+\)\=\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
29
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
30 " floating point number, starting with a dot, optional exponent
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
31 syn match chaiscriptFloat "\.\d\+\%(e[-+]\=\d\+\)\=\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
32
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
33 " floating point number, without dot, with exponent
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
34 syn match chaiscriptFloat "\<\d\+e[-+]\=\d\+\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
35
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
36 " Hex strings
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
37 syn match chaiscriptNumber "\<0x\x\+\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
38
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
39 " Binary strings
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
40 syn match chaiscriptNumber "\<0b[01]\+\>"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
41
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
42 " Various language features
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
43 syn keyword chaiscriptCond if else
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
44 syn keyword chaiscriptRepeat while for do
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
45 syn keyword chaiscriptStatement break continue return
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
46 syn keyword chaiscriptExceptions try catch throw
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
47
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
48 "Keyword
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
49 syn keyword chaiscriptKeyword def true false attr
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
50
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
51 "Built in types
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
52 syn keyword chaiscriptType fun var
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
53
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
54 "Built in funcs, keep it simple
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
55 syn keyword chaiscriptFunc eval throw
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
56
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
57 "Let's treat all backtick operator function lookups as built in too
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
58 syn region chaiscriptFunc matchgroup=chaiscriptFunc start="`" end="`"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
59
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
60 " Account for the "[1..10]" syntax, treating it as an operator
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
61 " Intentionally leaving out all of the normal, well known operators
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
62 syn match chaiscriptOperator "\.\."
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
63
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
64 " Guard seperator as an operator
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
65 syn match chaiscriptOperator ":"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
66
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
67 " Comments
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
68 syn match chaiscriptComment "//.*$" contains=@Spell
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
69 syn region chaiscriptComment matchgroup=chaiscriptComment start="/\*" end="\*/" contains=@Spell
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
70
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
71
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
72
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
73 hi def link chaiscriptExceptions Exception
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
74 hi def link chaiscriptKeyword Keyword
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
75 hi def link chaiscriptStatement Statement
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
76 hi def link chaiscriptRepeat Repeat
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
77 hi def link chaiscriptString String
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
78 hi def link chaiscriptNumber Number
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
79 hi def link chaiscriptFloat Float
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
80 hi def link chaiscriptOperator Operator
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
81 hi def link chaiscriptConstant Constant
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
82 hi def link chaiscriptCond Conditional
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
83 hi def link chaiscriptFunction Function
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
84 hi def link chaiscriptComment Comment
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
85 hi def link chaiscriptTodo Todo
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
86 hi def link chaiscriptError Error
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
87 hi def link chaiscriptSpecial SpecialChar
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
88 hi def link chaiscriptFunc Identifier
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
89 hi def link chaiscriptType Type
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
90 hi def link chaiscriptEval Special
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
91
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
92 let b:current_syntax = "chaiscript"
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
93
b9e314fe473f Updated runtime files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
94 " vim: nowrap sw=2 sts=2 ts=8 noet