@@ -24,10 +24,14 @@ # Bookmarks - match: '^!!.*|^\[\+\+\].*' scope: bookmark + # Bookmarks + - match: '^GRAPH_NAME:.*' + scope: bookmark + # Keywords are if, else. # Note that blackslashes don't need to be escaped within single quoted # strings in YAML. When using single quoted strings, only single quotes # need to be escaped: this is done by using two single quotes next to each # other. @@ -35,11 +39,11 @@ scope: keyword.python - match: '\b(?:True|False|None)\b' scope: constant.language - - match: '\b(?:spell|morph|morphex|stem|textarea0?\w*|before0?\w*|after0?\w*|word|option|define|select|exclude|analysex?|apposition|is[A-Z]\w+|rewriteSubject|checkD\w+|getD\w+|has[A-Z]\w+|sugg[A-Z]\w+|switch[A-Z]\w+|ceOrCet|formatN\w+|mbUnit)\b' + - match: '\b(?:spell|morph|morphex|g_morph|stem|textarea0?\w*|before0?\w*|after0?\w*|word|option|define|select|exclude|g_define|g_select|g_exclude|analysex?|apposition|is[A-Z]\w+|rewriteSubject|checkD\w+|getD\w+|has[A-Z]\w+|sugg[A-Z]\w+|switch[A-Z]\w+|ceOrCet|formatN\w+|mbUnit)\b' scope: entity.name.function - match: '\b(?:replace|endswith|startswith|search|upper|lower|capitalize|strip|rstrip|is(?:upper|lower|digit|title))\b' scope: support.function @@ -47,18 +51,26 @@ scope: support.function.debug - match: '\bre\b' scope: support.class - # Rule options + # Regex rule option - match: '^__[\[<]([isu])[\]>](/\w+|)(\(\w+\)|)(![0-9]|)__|' scope: rule.options captures: 1: rule.casing 2: rule.optionname 3: rule.rulename 4: rule.priority + + # Graph rules option + - match: '^__(\w+)(![0-9]|)__' + scope: rule.options + captures: + 1: rule.rulename2 + 2: rule.priority + # Definitions and options - match: '^OPT(?:GROUP|LANG|PRIORITY)/|^OPTSOFTWARE:' scope: options.command @@ -84,20 +96,31 @@ scope: keyword.action - match: '__also__' scope: keyword.condition.green - match: '__else__' scope: keyword.condition.red - - match: '-(\d*)>>' + - match: '-(\d*(?::\d+|))>>' scope: keyword.error captures: 1: keyword.error.group - - match: '~(\d*)>>' + - match: '~(\d*(?::\d+|))>>' scope: keyword.textprocessor captures: 1: keyword.textprocessor.group - match: '=>>' scope: keyword.disambiguator + + # Tokens + - match: '>\w+' + scope: string.lemma + + - match: '~(?!(?:\d+(?::\d+|)|)>>)[^\s]+' + scope: string.regex + + - match: '@[^@][^\s]+' + scope: string.morph + # Escaped chars - match: '\\(?:\d+|w|d|b|n|s|t)' scope: constant.character.escape @@ -108,11 +131,11 @@ # Example errors - match: '{{.+?}}' scope: message.error # special chars - - match: '[@=*^?!:+<>]' + - match: '[@=*^?!:+<>~]' scope: keyword.other - match: '\(\?(?:[:=!]|