From 50e65c1f21084e4a2162ba48eaad080f1ba430e2 Mon Sep 17 00:00:00 2001
From: Mooffie <mooffie@gmail.com>
Date: Sun, 4 Dec 2016 23:32:23 +0200
Subject: [PATCH] Ticket #3293: YAML syntax fixes.
---
misc/syntax/Syntax.in | 2 +-
misc/syntax/yaml.syntax | 38 +++++++++++++++++++++++++++++---------
2 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/misc/syntax/Syntax.in b/misc/syntax/Syntax.in
index 2877b96..92abe3a 100644
a
|
b
|
include cuda.syntax |
271 | 271 | file .\*\\.(cl)$ OpenCL\sProgram |
272 | 272 | include opencl.syntax |
273 | 273 | |
274 | | file ..\*\\.(yml|YML)$ YAML\sFile |
| 274 | file ..\*\\.(ya?ml|YML)$ YAML\sFile |
275 | 275 | include yaml.syntax |
276 | 276 | |
277 | 277 | file .\* unknown |
diff --git a/misc/syntax/yaml.syntax b/misc/syntax/yaml.syntax
index b6e6473..e416e3c 100644
a
|
b
|
|
1 | 1 | # YAML syntax highlighting |
2 | | # |
3 | | # Author: Roman Belda <romanbelda.cz@gmail.com> |
4 | | # http://romanbelda.cz |
5 | 2 | |
6 | | caseinsensitive |
| 3 | # Reference: |
| 4 | # https://en.wikipedia.org/wiki/YAML |
| 5 | # http://yaml.org/refcard.html |
7 | 6 | |
8 | | context default brown |
9 | | keyword #*\n green |
| 7 | context default |
| 8 | spellcheck |
| 9 | keyword #*\n brown |
10 | 10 | keyword {{*}} brightred |
11 | | keyword *: yellow |
| 11 | keyword linestart --- brightcyan |
| 12 | keyword linestart \[\s\]-\s brightcyan |
| 13 | # "YAML requires that colons and commas used as list separators be followed by a space [...]" |
| 14 | keyword ,\{\s\n\} brightcyan |
| 15 | keyword , red |
| 16 | # Below, we can get by with just "*:\{\s\n\}", but we prefer to restrict the |
| 17 | # key names in order not to grab too much (e.g., "{one: 1, two: 2}", "one: 1 # possibilities: 1 or 2"). |
| 18 | keyword \{0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\}\[\s-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz\]:\{\s\n\} yellow |
| 19 | keyword [ brightcyan |
| 20 | keyword ] brightcyan |
| 21 | keyword { brightcyan |
| 22 | keyword } brightcyan |
| 23 | keyword whole true brightmagenta |
| 24 | keyword whole false brightmagenta |
| 25 | keyword whole null brightmagenta |
12 | 26 | |
13 | | context " "\n brightgreen |
| 27 | context " " green |
| 28 | spellcheck |
14 | 29 | keyword {{*}} brightred |
| 30 | keyword \\" brightgreen |
| 31 | keyword \\\\ brightgreen |
| 32 | keyword \\\{xuU\}\[0123456789\] brightgreen |
| 33 | keyword \\\{0abfnrtve_NLP\} brightgreen |
15 | 34 | |
16 | | context ' '\n brightgreen |
| 35 | context ' ' green |
| 36 | spellcheck |
17 | 37 | keyword {{*}} brightred |