Major optimization for loading syntax files

This commit is contained in:
Zachary Yedidia
2016-04-18 14:40:07 -04:00
parent 273401d911
commit 47c32dda22
11 changed files with 348 additions and 219 deletions

View File

@@ -28,23 +28,3 @@ color yellow "#.*$"
color brightyellow ""(\\.|[^\"])*"" "'(\\.|[^'])*'"
## Trailing space is bad!
color ,green "[[:space:]]+$"
## Here is an example for Portage control files
##
syntax "etc-portage" "\.(keywords|mask|unmask|use)$"
## Base text:
color green "^.+$"
## Use flags:
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
## Likely version numbers:
color magenta "-[[:digit:]].*([[:space:]]|$)"
## Accepted arches:
color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\>"
color white "[[:space:]][~-]?\*"
## Categories:
color cyan "^[[:space:]]*.*/"
## Masking regulators:
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
## Comments:
color yellow "#.*$"

View File

@@ -0,0 +1,19 @@
## Here is an example for Portage control files
##
syntax "etc-portage" "\.(keywords|mask|unmask|use)$"
## Base text:
color green "^.+$"
## Use flags:
color brightred "[[:space:]]+\+?[a-zA-Z0-9_-]+"
color brightblue "[[:space:]]+-[a-zA-Z0-9_-]+"
## Likely version numbers:
color magenta "-[[:digit:]].*([[:space:]]|$)"
## Accepted arches:
color white "[~-]?\<(alpha|amd64|arm|hppa|ia64|mips|ppc|ppc64|s390|sh|sparc|x86|x86-fbsd)\>"
color white "[[:space:]][~-]?\*"
## Categories:
color cyan "^[[:space:]]*.*/"
## Masking regulators:
color brightmagenta "^[[:space:]]*(=|~|<|<=|=<|>|>=|=>)"
## Comments:
color yellow "#.*$"

View File

@@ -1,16 +1,7 @@
syntax "git-config" "git(config|modules)$|\.git/config$"
color constant "\<(true|false)\>"
color keyword "^[[:space:]]*[^=]*="
color constant "^[[:space:]]*\[.*\]$"
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
color comment "(^|[[:space:]])#([^{].*)?$"
# This code is free software; you can redistribute it and/or modify it under
# the terms of the new BSD License.
#
# Copyright (c) 2010, Sebastian Staudt
# A nano configuration file to enable syntax highlighting of some Git specific
# files with the GNU nano text editor (http://www.nano-editor.org)
#
@@ -45,34 +36,3 @@ color special "#"
# Trailing spaces (+LINT is not ok, git uses tabs)
color ,error "[[:space:]]+$"
# This syntax format is used for interactive rebasing
syntax "git-rebase-todo" "git-rebase-todo"
# Default
color ignore ".*"
# Comments
color comment "^#.*"
# Rebase commands
color keyword "^(e|edit) [0-9a-f]{7,40}"
color keyword "^# (e, edit)"
color keyword "^(f|fixup) [0-9a-f]{7,40}"
color keyword "^# (f, fixup)"
color keyword "^(p|pick) [0-9a-f]{7,40}"
color keyword "^# (p, pick)"
color keyword "^(r|reword) [0-9a-f]{7,40}"
color keyword "^# (r, reword)"
color keyword "^(s|squash) [0-9a-f]{7,40}"
color keyword "^# (s, squash)"
color keyword "^(x|exec) [^ ]+ [0-9a-f]{7,40}"
color keyword "^# (x, exec)"
# Recolor hash symbols
color special "#"
# Commit IDs
color identifier "[0-9a-f]{7,40}"

View File

@@ -0,0 +1,7 @@
syntax "git-config" "git(config|modules)$|\.git/config$"
color constant "\<(true|false)\>"
color keyword "^[[:space:]]*[^=]*="
color constant "^[[:space:]]*\[.*\]$"
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
color comment "(^|[[:space:]])#([^{].*)?$"

View File

@@ -0,0 +1,28 @@
# This syntax format is used for interactive rebasing
syntax "git-rebase-todo" "git-rebase-todo"
# Default
color ignore ".*"
# Comments
color comment "^#.*"
# Rebase commands
color keyword "^(e|edit) [0-9a-f]{7,40}"
color keyword "^# (e, edit)"
color keyword "^(f|fixup) [0-9a-f]{7,40}"
color keyword "^# (f, fixup)"
color keyword "^(p|pick) [0-9a-f]{7,40}"
color keyword "^# (p, pick)"
color keyword "^(r|reword) [0-9a-f]{7,40}"
color keyword "^# (r, reword)"
color keyword "^(s|squash) [0-9a-f]{7,40}"
color keyword "^# (s, squash)"
color keyword "^(x|exec) [^ ]+ [0-9a-f]{7,40}"
color keyword "^# (x, exec)"
# Recolor hash symbols
color special "#"
# Commit IDs
color identifier "[0-9a-f]{7,40}"

View File

@@ -1,10 +1,3 @@
syntax "Privoxy-config" "privoxy/config$"
color cyan "(accept-intercepted-requests|actionsfile|admin-address|allow-cgi-request-crunching|buffer-limit|compression-level|confdir|connection-sharing|debug|default-server-timeout|deny-access|enable-compression|enable-edit-actions|enable-remote-http-toggle|enable-remote-toggle|enforce-blocks|filterfile|forward|forwarded-connect-retries|forward-socks4|forward-socks4a|forward-socks5|handle-as-empty-doc-returns-ok|hostname|keep-alive-timeout|listen-address|logdir|logfile|max-client-connections|permit-access|proxy-info-url|single-threaded|socket-timeout|split-large-forms|templdir|toggle|tolerate-pipelining|trustfile|trust-info-url|user-manual)[[:space:]]"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"
color ,red " + +| + +"
syntax "Privoxy-action" "\.action$"
color brightred "[{[:space:]]\-block([[:space:]{}]|$)"
@@ -16,12 +9,3 @@ color magenta "\\.?"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"
color ,red " + +| + +"
syntax "Privoxy-filter" "\.filter$"
color cyan "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER): [a-z-]+"
color brightblue "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER):"
color magenta "\\.?"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"
color ,red " + +| + +"

View File

@@ -0,0 +1,6 @@
syntax "Privoxy-config" "privoxy/config$"
color cyan "(accept-intercepted-requests|actionsfile|admin-address|allow-cgi-request-crunching|buffer-limit|compression-level|confdir|connection-sharing|debug|default-server-timeout|deny-access|enable-compression|enable-edit-actions|enable-remote-http-toggle|enable-remote-toggle|enforce-blocks|filterfile|forward|forwarded-connect-retries|forward-socks4|forward-socks4a|forward-socks5|handle-as-empty-doc-returns-ok|hostname|keep-alive-timeout|listen-address|logdir|logfile|max-client-connections|permit-access|proxy-info-url|single-threaded|socket-timeout|split-large-forms|templdir|toggle|tolerate-pipelining|trustfile|trust-info-url|user-manual)[[:space:]]"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"
color ,red " + +| + +"

View File

@@ -0,0 +1,8 @@
syntax "Privoxy-filter" "\.filter$"
color cyan "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER): [a-z-]+"
color brightblue "^(FILTER|CLIENT-HEADER-FILTER|CLIENT-HEADER-TAGGER|SERVER-HEADER-FILTER|SERVER-HEADER-TAGGER):"
color magenta "\\.?"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"
color ,red " + +| + +"