Ticket #3293: 3293-YAML-syntax-fixes.patch

File 3293-YAML-syntax-fixes.patch, 2.4 KB (added by mooffie, 2 years ago)
  • misc/syntax/Syntax.in

    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 
    271271file .\*\\.(cl)$ OpenCL\sProgram 
    272272include opencl.syntax 
    273273 
    274 file ..\*\\.(yml|YML)$ YAML\sFile 
     274file ..\*\\.(ya?ml|YML)$ YAML\sFile 
    275275include yaml.syntax 
    276276 
    277277file .\* unknown 
  • misc/syntax/yaml.syntax

    diff --git a/misc/syntax/yaml.syntax b/misc/syntax/yaml.syntax
    index b6e6473..e416e3c 100644
    a b  
    11# YAML syntax highlighting 
    2 # 
    3 # Author: Roman Belda <romanbelda.cz@gmail.com> 
    4 # http://romanbelda.cz 
    52 
    6 caseinsensitive 
     3# Reference: 
     4#   https://en.wikipedia.org/wiki/YAML 
     5#   http://yaml.org/refcard.html 
    76 
    8 context default brown 
    9     keyword #*\n green 
     7context default 
     8    spellcheck 
     9    keyword #*\n brown 
    1010    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 
    1226 
    13 context " "\n brightgreen 
     27context " " green 
     28    spellcheck 
    1429    keyword {{*}} brightred 
     30    keyword \\" brightgreen 
     31    keyword \\\\ brightgreen 
     32    keyword \\\{xuU\}\[0123456789\] brightgreen 
     33    keyword \\\{0abfnrtve_NLP\} brightgreen 
    1534 
    16 context ' '\n brightgreen 
     35context ' ' green 
     36    spellcheck 
    1737    keyword {{*}} brightred