;;; f90-interface-browser.el --- Parse and browse f90 interfaces
-;; Copyright (C) 2011, 2012, 2013, 2014 Free Software Foundation, Inc
+;; Copyright (C) 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc
;; Author: Lawrence Mitchell <wence@gmx.li>
;; Created: 2011-07-06
Recurse over all (non-hidden) directories below DIR and parse
interfaces found within them using `f90-parse-interfaces-in-dir',
-a directory is considered hidden if it's name doesn't start with
+a directory is considered hidden if its name doesn't start with
an alphanumeric character."
(interactive "DParse files in tree: ")
(let (dirs
(loop for file in (directory-files dir t
(rx-to-string
`(and "." (or ,@f90-file-extensions)
- eos) t))
+ eos)
+ t))
do (f90-parse-interfaces file f90-all-interfaces)))
(defun f90-find-tag-interface (name &optional match-sublist)
"UNION-TYPE"
;; Ignore name
(setq type (cdr type))
- (mapconcat 'identity (loop for a in type
+ (mapconcat #'identity (loop for a in type
if (and (consp a)
(string= (car a) "dimension"))
collect (format "dimension(%s)"
- (mapconcat 'identity
+ (mapconcat #'identity
(make-list (cdr a)
":")
","))
arglist "\n")))
(f90-mode)
(if (fboundp 'font-lock-ensure)
- (font-lock-ensure) (font-lock-fontify-buffer))
+ (font-lock-ensure)
+ (with-no-warnings (font-lock-fontify-buffer)))
(goto-char (point-min))
- (mapconcat 'identity
+ (mapconcat #'identity
(loop while (not (eobp))
collect (buffer-substring (line-beginning-position)
(- (line-end-position)
(defun f90-insert-fluidity-refcount (file fname)
"Insert a Fluidity reference count template for FILE.
-If FNAME matches \\\\`Reference_count_.*\\\\.F90 then this file
+If FNAME matches \\\\=`Reference_count_\\([^\\.]+\\)\\.F90 then this file
needs a reference count interface, so insert one."
(when (string-match "\\`Reference_count_\\([^\\.]+\\)\\.F90" fname)
(insert-file-contents-literally
(defun f90-parse-type-definition ()
"Parse a type definition at (or in front of) `point'."
- (let (type slots slot fn)
- (goto-char (point-min))
- (unless (re-search-forward "^[ \t]*type[ \t]+\\(.+?\\)[ \t]*$" nil t)
- (error "Trying parse a type but no type found"))
- (setq type (format "type(%s)" (f90-normalise-string (match-string 1))))
+ (goto-char (point-min))
+ (unless (re-search-forward "^[ \t]*type[ \t]+\\(.+?\\)[ \t]*$" nil t)
+ (error "Trying parse a type but no type found"))
+ (let ((type (format "type(%s)" (f90-normalise-string (match-string 1))))
+ (slots ()))
(while (not (eobp))
- (setq slot (f90-parse-single-type-declaration))
- (when slot
- (setf slots (nconc slot slots)))
- (forward-line 1))
+ (let ((slot (f90-parse-single-type-declaration)))
+ (when slot
+ (setf slots (nconc slot slots)))
+ (forward-line 1)))
(setf (gethash type f90-types) slots)))
(defun f90-arglist-types ()