Commit a73483d2 authored by Raymond Toy's avatar Raymond Toy
Browse files

Add support for Fortran 90 CYCLE and EXIT.

f2cl1.l:
o Parse CYCLE and EXIT

macros.l:
o Add EXIT label to FDO so we can exit the loop using F90 EXIT.
parent 91e90dbf
......@@ -17,7 +17,7 @@
"Use (f2cl-version) instead")
(defparameter *f2cl1-version*
"$Id: f2cl1.l,v f0f149e72999 2010/10/08 03:05:30 rtoy $")
"$Id: f2cl1.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $")
;; Forward declarations.
(defvar *f2cl2-version*)
......@@ -1389,6 +1389,13 @@ correctly"
(when (eq (car x) 'close)
(return (parse-close x)))
;; Fortran 90 extensions:
(when (eq (car x) 'exit)
(return (parse-exit x)))
(when (eq (car x) 'cycle)
(return (parse-cycle x)))
;;fall out the bottom:
(warn "F2CL did not translate: ~S" (write-to-string (check_new_vbles x)))
......@@ -2933,6 +2940,12 @@ correctly"
;;(format t "~A~%" *equivalenced-vars*)
nil))
(defun parse-exit (x)
'((go f2cl-lib::exit)))
(defun parse-cycle (x)
'((go loop)))
;=============================================================================
;parsing utilities
......@@ -3332,7 +3345,7 @@ loop2
;;;-----------------------------------------------------------------------------
;;; end of f2cl1.l
;;;
;;; $Id: f2cl1.l,v f0f149e72999 2010/10/08 03:05:30 rtoy $
;;; $Id: f2cl1.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $
;;; $Log$
;;; Revision 1.222 2010/10/08 03:05:30 rtoy
;;; src/f2cl1.l:
......
......@@ -6,7 +6,7 @@
(in-package :f2cl-lib)
(defparameter *f2cl-macros-version*
"$Id: macros.l,v 11bea7dae5a0 2011/06/11 17:53:39 toy $")
"$Id: macros.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $")
(eval-when
#+gcl (compile load eval)
......@@ -266,7 +266,8 @@ is not included")
(append body
`((setq ,loop-var (the integer4 ,(third do_vble_clause))
,iteration_count (the integer4 (1- ,iteration_count)))))
'((go loop)))))))))
'((go loop))))))
exit)))
;;----------------------------------------------------------------------------
;; macro for division
......@@ -1527,7 +1528,7 @@ causing all pending operations to be flushed"
;;;-------------------------------------------------------------------------
;;; end of macros.l
;;;
;;; $Id: macros.l,v 11bea7dae5a0 2011/06/11 17:53:39 toy $
;;; $Id: macros.l,v 5ee73ed2713b 2011/11/23 21:02:33 toy $
;;; $Log$
;;; Revision 1.117 2011/02/28 22:21:07 rtoy
;;; When opening an old file, we should set :if-exists to :overwrite to
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment