diff options
| author | Simon Marshall | 1997-12-04 19:47:59 +0000 |
|---|---|---|
| committer | Simon Marshall | 1997-12-04 19:47:59 +0000 |
| commit | 87002f70a3ac026295ea0eb4289353cbe62d1341 (patch) | |
| tree | 7960f7baea7bbc0f74d0a5b99e2e9500dff843ed | |
| parent | 0561decbb52019cd265516cd3e637829d72d5a1a (diff) | |
| download | emacs-87002f70a3ac026295ea0eb4289353cbe62d1341.tar.gz emacs-87002f70a3ac026295ea0eb4289353cbe62d1341.zip | |
Deal with `#'s in variable references.
| -rw-r--r-- | lisp/progmodes/sh-script.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index fa53fbca6d8..4898a16ac94 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -628,7 +628,14 @@ See `sh-feature'.") | |||
| 628 | 628 | ||
| 629 | (defconst sh-font-lock-syntactic-keywords | 629 | (defconst sh-font-lock-syntactic-keywords |
| 630 | ;; Mark a `#' character as having punctuation syntax in a variable reference. | 630 | ;; Mark a `#' character as having punctuation syntax in a variable reference. |
| 631 | '(("\\$[({]?\\(#\\)" 1 (1 . nil)))) | 631 | ;; Really we should do this properly. From Chet Ramey and Brian Fox: |
| 632 | ;; "A `#' begins a comment when it is unquoted and at the beginning of a | ||
| 633 | ;; word. In the shell, words are separated by metacharacters." | ||
| 634 | ;; To do this in a regexp would be slow as it would be anchored to the right. | ||
| 635 | ;; But I can't be bothered to write a function to do it properly and | ||
| 636 | ;; efficiently. So we only do it properly for `#' in variable references and | ||
| 637 | ;; do it efficiently by anchoring the regexp to the left. | ||
| 638 | '(("\\${?[^}#\n\t ]*\\(##?\\)" 1 (1 . nil)))) | ||
| 632 | 639 | ||
| 633 | ;; mode-command and utility functions | 640 | ;; mode-command and utility functions |
| 634 | 641 | ||