Оптимизация процедур

This commit is contained in:
svkalinin 2022-12-09 11:34:54 +03:00
parent 28ceaf1c67
commit 508933006e
2 changed files with 13 additions and 7 deletions

View File

@ -78,13 +78,7 @@ namespace eval Highlight {} {
ctext::addHighlightClassForRegexp $txt comments #666666 {(#|//)[^\n\r]*}
}
proc YML {txt} {
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}
ctext::addHighlightClassForRegexp $txt stackControl #19a2a6 {\s*?[\w]+:}
ctext::addHighlightClassForRegexp $txt vars #4471ca {(\$|\*|\&)(\{|)[\.a-zA-Z0-9\_\-]+}
ctext::addHighlightClassForRegexp $txt varsansible #4471ca {(\{\{)(\s*?|)[\.a-zA-Z0-9\_\-]+((\s*?|))(\}\})}
ctext::addHighlightClassForSpecialChars $txt brackets green {[]{}()}
ctext::addHighlightClassForRegexp $txt paths lightblue {\.[a-zA-Z0-9\_\-]+}
ctext::addHighlightClassForRegexp $txt comments #666666 {(#|//)[^\n\r]*}
Highlight::YAML $txt
}
proc XML {txt} {
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}
@ -104,6 +98,9 @@ namespace eval Highlight {} {
ctext::addHighlightClassForSpecialChars $txt tags lightgreen {<>/}
ctext::addHighlightClassForRegexp $txt comments #666666 {(<\!--)\s*(.+)\s*(-->)}
}
proc HTM {txt} {
Highlight::HTML $txt
}
proc RB {txt} {
ctext::addHighlightClassForRegexp $txt qoute #b84a0c {("|'|`).*?("|'|`)}
ctext::addHighlightClassForRegexp $txt flags orange {\s-[a-zA-Z]+}

View File

@ -71,10 +71,19 @@ dict set lexers INI tabSize 4
dict set lexers INI procFindString {(\[)PROCNAME(\])}
dict set lexers INI procRegexpCommand {regexp -nocase -all -- {^\s*?(\[)([a-zA-Z0-9\-_:]+?)(\])$} $line match keyWord procName}
# -------------------------------------------------
# HTML
dict set lexers HTML commentSymbol {<\!--}
dict set lexers HTML tabSize 4
dict set lexers HTML procFindString {<h[0-9]>(<.+>|)PROCNAME(</.+>|)</h[0-9]>}
dict set lexers HTML procRegexpCommand {regexp -nocase -all -- {<h[0-9]>(<.+>|)(.+?)(</.+>|)</h[0-9]>} $line match v1 procName v2}
# -------------------------------------------------
# HTM
dict set lexers HTM commentSymbol {<\!--}
dict set lexers HTM tabSize 4
dict set lexers HTM procFindString {<h[0-9]>(<.+>|)PROCNAME(</.+>|)</h[0-9]>}
dict set lexers HTM procRegexpCommand {regexp -nocase -all -- {<h[0-9]>(<.+>|)(.+?)(</.+>|)</h[0-9]>} $line match v1 procName v2}
# -------------------------------------------------
dict set lexers ALL varDirectory {variables vars group_vars host_vars defaults}