Index: gc_lang/fr/rules_graph.grx ================================================================== --- gc_lang/fr/rules_graph.grx +++ gc_lang/fr/rules_graph.grx @@ -37,11 +37,11 @@ # ERREURS COURANTES # http://fr.wikipedia.org/wiki/Wikip%C3%A9dia:Fautes_d%27orthographe/Courantes -GRAPH_NAME: test_graph +GRAPH_NAME: test_graph __da1__ ne >donner <<- =>> select(\2, ":V") Index: misc/grammalecte.sublime-syntax ================================================================== --- misc/grammalecte.sublime-syntax +++ misc/grammalecte.sublime-syntax @@ -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: '\(\?(?:[:=!]|italic foreground #A0A0A0 + + name + Rule name + scope + rule.rulename2 + settings + + foreground + #F0D080 + + name Rule priority scope rule.priority @@ -356,10 +367,50 @@ foreground #F06060 + + name + String lemma + scope + string.lemma + settings + + foreground + #FF3030 + background + #402020 + + + + name + String regex + scope + string.regex + settings + + foreground + #30FF30 + background + #204020 + + + + name + String morph + scope + string.morph + settings + + foreground + #8080FF + background + #202080 + + + name JavaScript Dollar scope