comparison lisp/progmodes/make-mode.el @ 22684:f1cde5061b0b

(makefile-font-lock-keywords): Recognize automatic variable references. (makefile-dependency-regex): Don't be fooled by colons in deps.
author Richard M. Stallman <rms@gnu.org>
date Fri, 03 Jul 1998 21:37:22 +0000
parents 712fd7860b32
children ab58591421a8
comparison
equal deleted inserted replaced
22683:0941a5743283 22684:f1cde5061b0b
232 232
233 ;; Note that the first big subexpression is used by font lock. Note 233 ;; Note that the first big subexpression is used by font lock. Note
234 ;; that if you change this regexp you must fix the imenu index 234 ;; that if you change this regexp you must fix the imenu index
235 ;; function defined at the end of the file. 235 ;; function defined at the end of the file.
236 (defconst makefile-dependency-regex 236 (defconst makefile-dependency-regex
237 "^ *\\([^ \n\t#:=]+\\([ \t]+[^ \t\n#:=]+\\)*\\)[ \t]*:\\([ \t]*$\\|\\([^=\n].*$\\)\\)" 237 "^ *\\([^ \n\t#:=]+\\([ \t]+\\([^ \t\n#:=]+\\|\\$[({][^ \t\n#})]+[})]\\)\\)*\\)[ \t]*:\\([ \t]*$\\|\\([^=\n].*$\\)\\)"
238 "Regex used to find dependency lines in a makefile.") 238 "Regex used to find dependency lines in a makefile.")
239 239
240 ;; Note that the first subexpression is used by font lock. Note that 240 ;; Note that the first subexpression is used by font lock. Note that
241 ;; if you change this regexp you must fix the imenu index function 241 ;; if you change this regexp you must fix the imenu index function
242 ;; defined at the end of the file. 242 ;; defined at the end of the file.
262 ;; Do dependencies. These get the function name face. 262 ;; Do dependencies. These get the function name face.
263 (list makefile-dependency-regex 1 'font-lock-function-name-face) 263 (list makefile-dependency-regex 1 'font-lock-function-name-face)
264 ;; 264 ;;
265 ;; Variable references even in targets/strings/comments: 265 ;; Variable references even in targets/strings/comments:
266 '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend) 266 '("\\$[({]\\([-a-zA-Z0-9_.]+\\)[}):]" 1 font-lock-constant-face prepend)
267 267 ;;
268 ;; Automatic variable references.
269 '("\\$\\([@%<?^+*]\\)" 1 font-lock-reference-face prepend)
270 ;;
268 ;; Highlight lines that contain just whitespace. 271 ;; Highlight lines that contain just whitespace.
269 ;; They can cause trouble, especially if they start with a tab. 272 ;; They can cause trouble, especially if they start with a tab.
270 '("^[ \t]+$" . makefile-space-face) 273 '("^[ \t]+$" . makefile-space-face)
271 274
272 ;; Highlight shell comments that Make treats as commands, 275 ;; Highlight shell comments that Make treats as commands,