Commit 955e3703 authored by Jonathan Shin Hayase's avatar Jonathan Shin Hayase Committed by Lars Ingebrigtsen
Browse files

Highlight zsh glob flags and qualifiers in sh-mode

* lisp/progmode/sh-script.el (sh-syntax-propertize-function):
Add regexps to highlight zsh glob flags and alternate qualifiers
without mistaking them for comments. (bug#19455).
parent 59550f7c
......@@ -1141,7 +1141,13 @@ subshells can nest."
;; metacharacters. The list of special chars is taken from
;; the single-unix spec of the shell command language (under
;; `quoting') but with `$' removed.
("\\(?:[^|&;<>()`\\\"' \t\n]\\|\\${\\)\\(#+\\)" (1 "_"))
("\\(?:[^|&;<>(`\\\"' \t\n]\\|\\${\\)\\(#+\\)" (1 "_"))
;; In addition, `#' at the beginning of closed parentheses
;; does not start a comment if the parentheses are not isolated
;; by metacharacters, excluding [()].
;; (e.g. `foo(#q/)' and `(#b)foo' in zsh)
("[^|&;<>(`\\\"' \t\n](\\(#+\\)" (1 "_"))
("(\\(#\\)[^)]+?)[^|&;<>)`\\\"' \t\n]" (1 "_"))
;; In a '...' the backslash is not escaping.
("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote)))
;; Make sure $@ and $? are correctly recognized as sexps.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment