aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love1998-04-15 16:25:44 +0000
committerDave Love1998-04-15 16:25:44 +0000
commit37c3edc4d17ed443340c1e100b9d0a5fcfd9ca74 (patch)
tree274d983a63189c31722b0bf799fb7b996c4b2cf0
parented29121d27adc780ecaed0f724e5de7e24725f6a (diff)
downloademacs-37c3edc4d17ed443340c1e100b9d0a5fcfd9ca74.tar.gz
emacs-37c3edc4d17ed443340c1e100b9d0a5fcfd9ca74.zip
Move eval-when-compile off top level.
-rw-r--r--lisp/progmodes/fortran.el176
1 files changed, 89 insertions, 87 deletions
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index 8937218dfbc..1b5bb8ae797 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -255,9 +255,9 @@ format style.")
255(defconst fortran-font-lock-keywords-3 nil 255(defconst fortran-font-lock-keywords-3 nil
256 "Gaudy level highlighting for Fortran mode.") 256 "Gaudy level highlighting for Fortran mode.")
257 257
258(eval-when-compile 258(let ((comment-chars "c!*")
259 (let ((comment-chars "c!*") 259 (fortran-type-types
260 (fortran-type-types 260 (eval-when-compile
261 (regexp-opt 261 (regexp-opt
262 (let ((simple-types '("character" "byte" "integer" "logical" 262 (let ((simple-types '("character" "byte" "integer" "logical"
263 "none" "real" "complex" 263 "none" "real" "complex"
@@ -270,94 +270,96 @@ format style.")
270 simple-types 270 simple-types
271 (mapcar (lambda (x) (concat "end[ \t]*" x)) structured-types) 271 (mapcar (lambda (x) (concat "end[ \t]*" x)) structured-types)
272 structured-types 272 structured-types
273 other-types)))) 273 other-types)))))
274 (fortran-keywords 274 (fortran-keywords
275 (eval-when-compile
275 (regexp-opt '("continue" "format" "end" "enddo" "if" "then" 276 (regexp-opt '("continue" "format" "end" "enddo" "if" "then"
276 "else" "endif" "elseif" "while" "inquire" "stop" 277 "else" "endif" "elseif" "while" "inquire" "stop"
277 "return" "include" "open" "close" "read" "write" 278 "return" "include" "open" "close" "read" "write"
278 "format" "print" "select" "case"))) 279 "format" "print" "select" "case"))))
279 (fortran-logicals 280 (fortran-logicals
281 (eval-when-compile
280 (regexp-opt '("and" "or" "not" "lt" "le" "eq" "ge" "gt" "ne" 282 (regexp-opt '("and" "or" "not" "lt" "le" "eq" "ge" "gt" "ne"
281 "true" "false")))) 283 "true" "false")))))
282 284
283 (setq fortran-font-lock-keywords-1 285 (setq fortran-font-lock-keywords-1
284 (list 286 (list
285 ;; 287 ;;
286 ;; Fontify syntactically (assuming strings cannot be quoted 288 ;; Fontify syntactically (assuming strings cannot be quoted
287 ;; or span lines). 289 ;; or span lines).
288 (cons (concat "^[" comment-chars "].*") 'font-lock-comment-face) 290 (cons (concat "^[" comment-chars "].*") 'font-lock-comment-face)
289 '(fortran-match-!-comment . font-lock-comment-face) 291 '(fortran-match-!-comment . font-lock-comment-face)
290 (list (concat "^[^" comment-chars "\t\n]" (make-string 71 ?.) 292 (list (concat "^[^" comment-chars "\t\n]" (make-string 71 ?.)
291 "\\(.*\\)") 293 "\\(.*\\)")
292 '(1 font-lock-comment-face)) 294 '(1 font-lock-comment-face))
293 '("\\(\\s\"\\)\"[^\n]*\\1?" . font-lock-string-face) 295 '("\\(\\s\"\\)\"[^\n]*\\1?" . font-lock-string-face)
294 ;; 296 ;;
295 ;; Program, subroutine and function declarations, plus calls. 297 ;; Program, subroutine and function declarations, plus calls.
296 (list (concat "\\<\\(block[ \t]*data\\|call\\|entry\\|function\\|" 298 (list (concat "\\<\\(block[ \t]*data\\|call\\|entry\\|function\\|"
297 "program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?") 299 "program\\|subroutine\\)\\>[ \t]*\\(\\sw+\\)?")
298 '(1 font-lock-keyword-face) 300 '(1 font-lock-keyword-face)
299 '(2 font-lock-function-name-face nil t)))) 301 '(2 font-lock-function-name-face nil t))))
300 302
301 (setq fortran-font-lock-keywords-2 303 (setq fortran-font-lock-keywords-2
302 (append fortran-font-lock-keywords-1 304 (append fortran-font-lock-keywords-1
303 (list 305 (list
304 ;; 306 ;;
305 ;; Fontify all type specifiers (must be first; see below). 307 ;; Fontify all type specifiers (must be first; see below).
306 (cons (concat "\\<\\(" fortran-type-types "\\)\\>") 308 (cons (concat "\\<\\(" fortran-type-types "\\)\\>")
307 'font-lock-type-face) 309 'font-lock-type-face)
308 ;; 310 ;;
309 ;; Fontify all builtin keywords (except logical, do 311 ;; Fontify all builtin keywords (except logical, do
310 ;; and goto; see below). 312 ;; and goto; see below).
311 (concat "\\<\\(" fortran-keywords "\\)\\>") 313 (concat "\\<\\(" fortran-keywords "\\)\\>")
312 ;; 314 ;;
313 ;; Fontify all builtin operators. 315 ;; Fontify all builtin operators.
314 (concat "\\.\\(" fortran-logicals "\\)\\.") 316 (concat "\\.\\(" fortran-logicals "\\)\\.")
315 ;; 317 ;;
316 ;; Fontify do/goto keywords and targets, and goto tags. 318 ;; Fontify do/goto keywords and targets, and goto tags.
317 (list "\\<\\(do\\|go *to\\)\\>[ \t]*\\([0-9]+\\)?" 319 (list "\\<\\(do\\|go *to\\)\\>[ \t]*\\([0-9]+\\)?"
318 '(1 font-lock-keyword-face) 320 '(1 font-lock-keyword-face)
319 '(2 font-lock-constant-face nil t)) 321 '(2 font-lock-constant-face nil t))
320 (cons "^ *\\([0-9]+\\)" 'font-lock-constant-face)))) 322 (cons "^ *\\([0-9]+\\)" 'font-lock-constant-face))))
321 323
322 (setq fortran-font-lock-keywords-3 324 (setq fortran-font-lock-keywords-3
323 (append 325 (append
324 ;; 326 ;;
325 ;; The list `fortran-font-lock-keywords-1'. 327 ;; The list `fortran-font-lock-keywords-1'.
326 fortran-font-lock-keywords-1 328 fortran-font-lock-keywords-1
327 ;; 329 ;;
328 ;; Fontify all type specifiers plus their declared items. 330 ;; Fontify all type specifiers plus their declared items.
329 (list 331 (list
330 (list (concat "\\<\\(" fortran-type-types "\\)\\>[ \t(/]*\\(*\\)?") 332 (list (concat "\\<\\(" fortran-type-types "\\)\\>[ \t(/]*\\(*\\)?")
331 ;; Fontify the type specifier. 333 ;; Fontify the type specifier.
332 '(1 font-lock-type-face) 334 '(1 font-lock-type-face)
333 ;; Fontify each declaration item (or just the /.../ block name). 335 ;; Fontify each declaration item (or just the /.../ block name).
334 '(font-lock-match-c-style-declaration-item-and-skip-to-next 336 '(font-lock-match-c-style-declaration-item-and-skip-to-next
335 ;; Start after any *(...) expression. 337 ;; Start after any *(...) expression.
336 (and (match-beginning 15) (forward-sexp)) 338 (and (match-beginning 15) (forward-sexp))
337 ;; No need to clean up. 339 ;; No need to clean up.
338 nil 340 nil
339 ;; Fontify as a variable name, functions are 341 ;; Fontify as a variable name, functions are
340 ;; fontified elsewhere. 342 ;; fontified elsewhere.
341 (1 font-lock-variable-name-face nil t)))) 343 (1 font-lock-variable-name-face nil t))))
342 ;; 344 ;;
343 ;; Things extra to `fortran-font-lock-keywords-3' 345 ;; Things extra to `fortran-font-lock-keywords-3'
344 ;; (must be done first). 346 ;; (must be done first).
345 (list 347 (list
346 ;; 348 ;;
347 ;; Fontify goto-like `err=label'/`end=label' in read/write 349 ;; Fontify goto-like `err=label'/`end=label' in read/write
348 ;; statements. 350 ;; statements.
349 '(", *\\(e\\(nd\\|rr\\)\\)\\> *\\(= *\\([0-9]+\\)\\)?" 351 '(", *\\(e\\(nd\\|rr\\)\\)\\> *\\(= *\\([0-9]+\\)\\)?"
350 (1 font-lock-keyword-face) (4 font-lock-constant-face nil t)) 352 (1 font-lock-keyword-face) (4 font-lock-constant-face nil t))
351 ;; 353 ;;
352 ;; Highlight standard continuation character and in a 354 ;; Highlight standard continuation character and in a
353 ;; TAB-formatted line. 355 ;; TAB-formatted line.
354 '("^ \\([^ 0]\\)" 1 font-lock-string-face) 356 '("^ \\([^ 0]\\)" 1 font-lock-string-face)
355 '("^\t\\([1-9]\\)" 1 font-lock-string-face)) 357 '("^\t\\([1-9]\\)" 1 font-lock-string-face))
356 ;; 358 ;;
357 ;; The list `fortran-font-lock-keywords-2' less that for types 359 ;; The list `fortran-font-lock-keywords-2' less that for types
358 ;; (see above). 360 ;; (see above).
359 (cdr (nthcdr (length fortran-font-lock-keywords-1) 361 (cdr (nthcdr (length fortran-font-lock-keywords-1)
360 fortran-font-lock-keywords-2)))))) 362 fortran-font-lock-keywords-2)))))
361 363
362(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1 364(defvar fortran-font-lock-keywords fortran-font-lock-keywords-1
363 "Default expressions to highlight in Fortran mode.") 365 "Default expressions to highlight in Fortran mode.")