diff options
| author | Glenn Morris | 2002-05-19 23:19:42 +0000 |
|---|---|---|
| committer | Glenn Morris | 2002-05-19 23:19:42 +0000 |
| commit | f14ca2504b9cf10f17b4b3c4a2aeb088703d7e24 (patch) | |
| tree | 72f5938c9fca009d53f8733afae1e6b6176ffce0 | |
| parent | 7340cc503b7543c86162a84c0f8bf98322450116 (diff) | |
| download | emacs-f14ca2504b9cf10f17b4b3c4a2aeb088703d7e24.tar.gz emacs-f14ca2504b9cf10f17b4b3c4a2aeb088703d7e24.zip | |
(f90-equal-symbols, f90-looking-at-do, f90-looking-at-select-case)
(f90-looking-at-if-then): Remove lets.
(f90-looking-at-where-or-forall): Handle if split over lines.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/progmodes/f90.el | 55 |
2 files changed, 27 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7537eed4ecb..83239ea6903 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | * progmodes/f90.el (f90-match-end, f90-break-line): Simplify a bit. | 3 | * progmodes/f90.el (f90-match-end, f90-break-line): Simplify a bit. |
| 4 | (f90-get-present-comment-type): Fix earlier change. | 4 | (f90-get-present-comment-type): Fix earlier change. |
| 5 | (f90-comment-indent): Doc fix. | 5 | (f90-comment-indent): Doc fix. |
| 6 | (f90-equal-symbols, f90-looking-at-do, f90-looking-at-select-case) | ||
| 7 | (f90-looking-at-if-then): Remove lets. | ||
| 8 | (f90-looking-at-where-or-forall): Handle if split over lines. | ||
| 6 | 9 | ||
| 7 | 2002-05-19 Richard M. Stallman <rms@gnu.org> | 10 | 2002-05-19 Richard M. Stallman <rms@gnu.org> |
| 8 | 11 | ||
diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index fe5134c086e..3f8478c19f0 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el | |||
| @@ -377,7 +377,7 @@ do\\([ \t]*while\\)?\\|select[ \t]*case\\|where\\|forall\\)\\)\\>" | |||
| 377 | '("\\<\\(case\\)[ \t]*\\(default\\|(\\)" . 1) | 377 | '("\\<\\(case\\)[ \t]*\\(default\\|(\\)" . 1) |
| 378 | '("\\<\\(do\\|go *to\\)\\>[ \t]*\\([0-9]+\\)" | 378 | '("\\<\\(do\\|go *to\\)\\>[ \t]*\\([0-9]+\\)" |
| 379 | (1 font-lock-keyword-face) (2 font-lock-constant-face)) | 379 | (1 font-lock-keyword-face) (2 font-lock-constant-face)) |
| 380 | ;; line numbers (lines whose first character after number is letter) | 380 | ;; Line numbers (lines whose first character after number is letter). |
| 381 | '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t)))) | 381 | '("^[ \t]*\\([0-9]+\\)[ \t]*[a-z]+" (1 font-lock-constant-face t)))) |
| 382 | "Highlights declarations, do-loops and other constructs.") | 382 | "Highlights declarations, do-loops and other constructs.") |
| 383 | 383 | ||
| @@ -918,44 +918,35 @@ For example, \"!\" or \"!!\"." | |||
| 918 | 918 | ||
| 919 | (defsubst f90-equal-symbols (a b) | 919 | (defsubst f90-equal-symbols (a b) |
| 920 | "Compare strings A and B neglecting case and allowing for nil value." | 920 | "Compare strings A and B neglecting case and allowing for nil value." |
| 921 | (let ((a-local (if a (downcase a) nil)) | 921 | (equal (if a (downcase a) nil) |
| 922 | (b-local (if b (downcase b) nil))) | 922 | (if b (downcase b) nil))) |
| 923 | (equal a-local b-local))) | ||
| 924 | 923 | ||
| 925 | ;; XEmacs 19.11 & 19.12 return a single char when matching an empty regexp. | 924 | ;; XEmacs 19.11 & 19.12 return a single char when matching an empty regexp. |
| 926 | ;; The next 2 functions are therefore longer than necessary. | 925 | ;; The next 2 functions are therefore longer than necessary. |
| 927 | (defsubst f90-looking-at-do () | 926 | (defsubst f90-looking-at-do () |
| 928 | "Return (\"do\" NAME) if a do statement starts after point. | 927 | "Return (\"do\" NAME) if a do statement starts after point. |
| 929 | NAME is nil if the statement has no label." | 928 | NAME is nil if the statement has no label." |
| 930 | (if (looking-at "\\(\\(\\sw+\\)[ \t]*\:\\)?[ \t]*\\(do\\)\\>") | 929 | (if (looking-at "\\(\\(\\sw+\\)[ \t]*:\\)?[ \t]*\\(do\\)\\>") |
| 931 | (let (label | 930 | (list (match-string 3) |
| 932 | (struct (match-string 3))) | 931 | (if (looking-at "\\(\\sw+\\)[ \t]*:") (match-string 1))))) |
| 933 | (if (looking-at "\\(\\sw+\\)[ \t]*\:") | ||
| 934 | (setq label (match-string 1))) | ||
| 935 | (list struct label)))) | ||
| 936 | 932 | ||
| 937 | (defsubst f90-looking-at-select-case () | 933 | (defsubst f90-looking-at-select-case () |
| 938 | "Return (\"select\" NAME) if a select-case statement starts after point. | 934 | "Return (\"select\" NAME) if a select-case statement starts after point. |
| 939 | NAME is nil if the statement has no label." | 935 | NAME is nil if the statement has no label." |
| 940 | (if (looking-at "\\(\\(\\sw+\\)[ \t]*\:\\)?[ \t]*\ | 936 | (if (looking-at "\\(\\(\\sw+\\)[ \t]*:\\)?[ \t]*\ |
| 941 | \\(select\\)[ \t]*case[ \t]*(") | 937 | \\(select\\)[ \t]*case[ \t]*(") |
| 942 | (let (label | 938 | (list (match-string 3) |
| 943 | (struct (match-string 3))) | 939 | (if (looking-at "\\(\\sw+\\)[ \t]*:") (match-string 1))))) |
| 944 | (if (looking-at "\\(\\sw+\\)[ \t]*\:") | ||
| 945 | (setq label (match-string 1))) | ||
| 946 | (list struct label)))) | ||
| 947 | 940 | ||
| 948 | (defsubst f90-looking-at-if-then () | 941 | (defsubst f90-looking-at-if-then () |
| 949 | "Return (\"if\" NAME) if an if () then statement starts after point. | 942 | "Return (\"if\" NAME) if an if () then statement starts after point. |
| 950 | NAME is nil if the statement has no label." | 943 | NAME is nil if the statement has no label." |
| 951 | (save-excursion | 944 | (save-excursion |
| 952 | (when (looking-at "\\(\\(\\sw+\\)[ \t]*\:\\)?[ \t]*\\(if\\)\\>") | 945 | (when (looking-at "\\(\\(\\sw+\\)[ \t]*:\\)?[ \t]*\\(if\\)\\>") |
| 953 | (let (label | 946 | (let ((struct (match-string 3)) |
| 954 | (struct (match-string 3))) | 947 | (label (if (looking-at "\\(\\sw+\\)[ \t]*:") (match-string 1))) |
| 955 | (if (looking-at "\\(\\sw+\\)[ \t]*\:") | 948 | (pos (scan-lists (point) 1 0))) |
| 956 | (setq label (match-string 1))) | 949 | (and pos (goto-char pos)) |
| 957 | (let ((pos (scan-lists (point) 1 0))) | ||
| 958 | (and pos (goto-char pos))) | ||
| 959 | (skip-chars-forward " \t") | 950 | (skip-chars-forward " \t") |
| 960 | (if (or (looking-at "then\\>") | 951 | (if (or (looking-at "then\\>") |
| 961 | (when (f90-line-continued) | 952 | (when (f90-line-continued) |
| @@ -964,16 +955,18 @@ NAME is nil if the statement has no label." | |||
| 964 | (looking-at "then\\>"))) | 955 | (looking-at "then\\>"))) |
| 965 | (list struct label)))))) | 956 | (list struct label)))))) |
| 966 | 957 | ||
| 967 | (defsubst f90-looking-at-where-or-forall () | 958 | (defun f90-looking-at-where-or-forall () |
| 968 | "Return (KIND NAME) if a where or forall block starts after point. | 959 | "Return (KIND NAME) if a where or forall block starts after point. |
| 969 | NAME is nil if the statement has no label." | 960 | NAME is nil if the statement has no label." |
| 970 | (if (looking-at "\\(\\(\\sw+\\)[ \t]*\:\\)?[ \t]*\ | 961 | (save-excursion |
| 971 | \\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)") | 962 | (when (looking-at "\\(\\(\\sw+\\)[ \t]*:\\)?[ \t]*\ |
| 972 | (let (label | 963 | \\(where\\|forall\\)\\>") |
| 973 | (struct (match-string 3))) | 964 | (let ((struct (match-string 3)) |
| 974 | (if (looking-at "\\(\\sw+\\)[ \t]*\:") | 965 | (label (if (looking-at "\\(\\sw+\\)[ \t]*:") (match-string 1))) |
| 975 | (setq label (match-string 1))) | 966 | (pos (scan-lists (point) 1 0))) |
| 976 | (list struct label)))) | 967 | (and pos (goto-char pos)) |
| 968 | (skip-chars-forward " \t") | ||
| 969 | (if (looking-at "\\(!\\|$\\)") (list struct label)))))) | ||
| 977 | 970 | ||
| 978 | (defsubst f90-looking-at-type-like () | 971 | (defsubst f90-looking-at-type-like () |
| 979 | "Return (KIND NAME) if a type/interface/block-data block starts after point. | 972 | "Return (KIND NAME) if a type/interface/block-data block starts after point. |