Enhancements: Batch, HTML, JS

- [Batch] Fix that using "::" as comments sometimes failed
- [html] Tabs give 2 spaces by default
- [JS] Tabs give 2 spaces by default; Allow comments to be inline with code.
- [Sh] Also highlight PKGBUILD; Fix `${v%tail}` not highlighted; Use shellcheck as linter
This commit is contained in:
davidhcefx 2023-04-13 22:13:39 +08:00
parent f0e9c6c863
commit 3465607c5a
4 changed files with 6 additions and 5 deletions

View File

@ -4,7 +4,7 @@
syntax "batch" "\.(bat|cmd)$"
header "^@[eE](cho|CHO) (on|off|ON|OFF)"
comment "::"
comment "REM "
# Native commands, symbols, and comparisons.
icolor green "\<(ASSOC|CALL|CD|CLS|CMDEXTVERSION|COLOR|COPY|DATE|DEL|DIR|ECHO|ENDLOCAL|ERASE|ERRORLEVEL|EXIT|FOR|FTYPE|GOTO|IF|MD|MKLINK|MOVE|PATH|PAUSE|POPD|PROMPT|PUSHD|RD|REM|REN|SET|SETLOCAL|SHIFT|START|TIME|TITLE|TYPE|VER|VERIFY|VOL)\>"

View File

@ -3,6 +3,7 @@
syntax "HTML" "\.html?(.j2)?(.twig)?$"
magic "HTML document"
comment "<!--|-->"
tabgives " "
## Emphasis tags
color brightwhite start="<([biu]|em|strong)[^>]*>" end="</([biu]|em|strong)>"

View File

@ -53,4 +53,4 @@ color red "\\[0-7][0-7]?[0-7]?|\\x[0-9a-fA-F]+|\\[bfnrt'"\?\\]"
## Comments
color brightblue start="^\s*/\*" end="\*/"
color brightblue "^\s*//.*$"
color brightblue "(^|\s)//.*$"

View File

@ -1,11 +1,11 @@
## Here is an example for Bourne shell scripts.
##
syntax "SH" "\.sh$" "\.ash$" "\.bashrc$" "bashrc$" "\.bash_aliases$" "bash_aliases$" "\.bash_functions$" "bash_functions$" "\.bash_login$" "\.bash_logout$" "\.bash_profile$" "bash_profile$" "\.profile$" "revise\..+$"
syntax "SH" "\.sh$" "\.ash$" "\.bashrc$" "bashrc$" "\.bash_aliases$" "bash_aliases$" "\.bash_functions$" "bash_functions$" "\.bash_login$" "\.bash_logout$" "\.bash_profile$" "bash_profile$" "\.profile$" "revise\..+$" "^PKGBUILD$"
header "^#!.*/(env +)?(ba|da|a)?sh( |$)"
magic "(POSIX|Bourne-Again) shell script.*text"
comment "#"
linter dash -n
linter shellcheck --format=gcc
## keywords:
color green "\<(case|do|done|elif|else|esac|fi|for|function|if|in|select|then|time|until|while)\>"
@ -17,7 +17,7 @@ color brightblue "\<(alias|bg|bind|break|builtin|caller|cd|command|compgen|compl
## not buitins:
## cat|chmod|chown|cp|env|grep|install|ln|make|mkdir|mv|rm|sed|tar|touch
icolor brightgreen "^\s+[0-9A-Z_]+\s+\(\)"
icolor brightred "\$\{?[0-9A-Z_!@#$*?-]+\}?"
icolor brightred "\$\{?[0-9A-Z_!@#%$*?-]+\}?"
color brightyellow ""(\\.|[^"])*"" "'(\\.|[^'])*'"
color cyan "(^|[[:space:]])#.*$"
color ,green "[[:space:]]+$"