summaryrefslogtreecommitdiffstats
path: root/syntax/toml.vim
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/toml.vim')
-rw-r--r--syntax/toml.vim12
1 files changed, 8 insertions, 4 deletions
diff --git a/syntax/toml.vim b/syntax/toml.vim
index 7a5b44f2..1decc5fb 100644
--- a/syntax/toml.vim
+++ b/syntax/toml.vim
@@ -28,6 +28,7 @@ syn region tomlString start=/'''/ end=/'''/
hi def link tomlString String
syn match tomlInteger /\<[+-]\=[0-9]\(_\=\d\)*\>/ display
+syn match tomlInteger /\<[+-]\=\(inf\|nan\)\>/ display
hi def link tomlInteger Number
syn match tomlFloat /\<[+-]\=[0-9]\(_\=\d\)*\.\d\+\>/ display
@@ -43,16 +44,19 @@ syn match tomlDate /\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?/ display
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}[T ]\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)\?/ display
hi def link tomlDate Constant
-syn region tomlKeyDq oneline start=/"/ end=/"/ contains=tomlEscape contained
+syn match tomlKey /\v(^|[{,])\s*\zs[[:alnum:]_-]+\ze\s*\=/ display
+hi def link tomlKey Identifier
+
+syn region tomlKeyDq oneline start=/\v(^|[{,])\s*\zs"/ end=/"\ze\s*=/ contains=tomlEscape
hi def link tomlKeyDq Identifier
-syn region tomlKeySq oneline start=/'/ end=/'/ contained
+syn region tomlKeySq oneline start=/\v(^|[{,])\s*\zs'/ end=/'\ze\s*=/
hi def link tomlKeySq Identifier
-syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKeyDq,tomlKeySq
+syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKey,tomlKeyDq,tomlKeySq
hi def link tomlTable Identifier
-syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKeyDq,tomlKeySq
+syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKey,tomlKeyDq,tomlKeySq
hi def link tomlTableArray Identifier
syn keyword tomlTodo TODO FIXME XXX BUG contained