[Python-modules-commits] [fparser] 02/05: Rename F2003 -> F2015 everywhere
Alastair McKinstry
mckinstry at moszumanska.debian.org
Fri Jul 28 10:45:43 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch dev-f2015
in repository fparser.
commit 630c6a3240021d566e7c0fd616b794dc9f17f9ae
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Tue Jul 25 13:57:36 2017 +0100
Rename F2003 -> F2015 everywhere
---
src/fparser/Fortran2015.py | 6 ++++++
src/fparser/block_statements.py | 2 +-
src/fparser/script_options.py | 4 ++--
src/fparser/scripts/{f2003.py => f2015.py} | 10 +++++-----
src/fparser/sourceinfo.py | 4 ++--
src/fparser/tests/test_Fortran2003.py | 2 +-
6 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/fparser/Fortran2015.py b/src/fparser/Fortran2015.py
index e172404..4326898 100644
--- a/src/fparser/Fortran2015.py
+++ b/src/fparser/Fortran2015.py
@@ -2501,6 +2501,12 @@ class Initialization(Base): # R506
match = staticmethod(match)
def tostr(self): return '%s %s' % self.items
+class Team_Number(Base): # R507
+ """
+ <team-number> = <scalar-int-expr>
+ """
+ subclass_names = ['Scalar_Int_Expr']
+
class Null_Init(STRINGBase): # R507
"""
<null-init> = <function-reference>
diff --git a/src/fparser/block_statements.py b/src/fparser/block_statements.py
index 22502a4..475b368 100644
--- a/src/fparser/block_statements.py
+++ b/src/fparser/block_statements.py
@@ -1364,7 +1364,7 @@ internal_subprogram = [Function, Subroutine]
internal_subprogram_part = [Contains, ] + internal_subprogram
-# In Fortran2003 we can have a Procedure declaration. We therefore
+# In Fortran2015 we can have a Procedure declaration. We therefore
# include SpecificBinding as a valid declaration construct.
declaration_construct = [TypeDecl, Entry, Enum, Format, Interface,
Parameter, ModuleProcedure, SpecificBinding] + \
diff --git a/src/fparser/script_options.py b/src/fparser/script_options.py
index bc79c70..1412d2a 100644
--- a/src/fparser/script_options.py
+++ b/src/fparser/script_options.py
@@ -92,12 +92,12 @@ Description:
)
parser.add_option_group(get_fortran_code_group(parser))
-def set_f2003_options(parser):
+def set_f2015_options(parser):
parser.set_usage('''\
%prog [options] <Fortran files>
Description:
- %prog parses Fortran codes using Fortran 2003 syntax rules.''')
+ %prog parses Fortran codes using Fortran 2015 syntax rules.''')
parser.add_option('--task',
default = 'show',
choices = ['show', 'none'],
diff --git a/src/fparser/scripts/f2003.py b/src/fparser/scripts/f2015.py
similarity index 95%
rename from src/fparser/scripts/f2003.py
rename to src/fparser/scripts/f2015.py
index 406c9b5..fdb4d33 100644
--- a/src/fparser/scripts/f2003.py
+++ b/src/fparser/scripts/f2015.py
@@ -71,19 +71,19 @@ try:
from iocbio.optparse_gui import OptionParser
except ImportError:
from optparse import OptionParser
-from fparser.script_options import set_f2003_options
+from fparser.script_options import set_f2015_options
def runner (parser, options, args):
- from fparser.api import Fortran2003
+ from fparser.api import Fortran2015
from fparser.readfortran import FortranFileReader
for filename in args:
reader = FortranFileReader(filename)
if options.mode != 'auto':
reader.set_mode_from_str(options.mode)
try:
- program = Fortran2003.Program(reader)
+ program = Fortran2015.Program(reader)
print program
- except Fortran2003.NoMatchError, msg:
+ except Fortran2015.NoMatchError, msg:
print 'parsing %r failed at %s' % (filename, reader.fifo_item[-1])
print 'started at %s' % (reader.fifo_item[0])
print 'quiting'
@@ -91,7 +91,7 @@ def runner (parser, options, args):
def main ():
parser = OptionParser()
- set_f2003_options(parser)
+ set_f2015_options(parser)
if hasattr(parser, 'runner'):
parser.runner = runner
options, args = parser.parse_args()
diff --git a/src/fparser/sourceinfo.py b/src/fparser/sourceinfo.py
index 7622103..90fc437 100644
--- a/src/fparser/sourceinfo.py
+++ b/src/fparser/sourceinfo.py
@@ -96,8 +96,8 @@ def get_source_info(filename):
"""
Determine if fortran file is
- in fix format and contains Fortran 77 code -> return False, True
- - in fix format and contains Fortran 90,95,2003,2008 code -> return False, False
- - in free format and contains Fortran 90,95,2003,2008 code -> return True, False
+ - in fix format and contains Fortran 90,95,2003,2008,2015 code -> return False, False
+ - in free format and contains Fortran 90,95,2003,2008,2015 code -> return True, False
- in free format and contains signatures (.pyf) -> return True, True
"""
base,ext = os.path.splitext(filename)
diff --git a/src/fparser/tests/test_Fortran2003.py b/src/fparser/tests/test_Fortran2003.py
index 21fe25e..dab0cf8 100644
--- a/src/fparser/tests/test_Fortran2003.py
+++ b/src/fparser/tests/test_Fortran2003.py
@@ -62,7 +62,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
# DAMAGE.
-from fparser.Fortran2003 import *
+from fparser.Fortran2015 import *
from fparser.api import get_reader
from nose.tools import assert_equal
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/fparser.git
More information about the Python-modules-commits
mailing list