From 145d85af8e610243024aa715d5470922b0450308 Mon Sep 17 00:00:00 2001 From: Rupert Ford Date: Thu, 28 Mar 2019 11:26:16 +0000 Subject: [PATCH] issue #171. Hack to remove statement function matching. --- src/fparser/scripts/fparser2.py | 1 + src/fparser/sergi_example.f90 | 4 ++++ src/fparser/two/Fortran2003.py | 6 +++++- src/fparser/two/Fortran2008.py | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 src/fparser/sergi_example.f90 diff --git a/src/fparser/scripts/fparser2.py b/src/fparser/scripts/fparser2.py index d04e2f5b..355ce6f2 100755 --- a/src/fparser/scripts/fparser2.py +++ b/src/fparser/scripts/fparser2.py @@ -98,6 +98,7 @@ def runner(_, options, args): f2003_parser = ParserFactory().create() program = f2003_parser(reader) print (program) + print (repr(program)) except FortranSyntaxError as msg: print ("Syntax error: {0}".format(str(msg))) try: diff --git a/src/fparser/sergi_example.f90 b/src/fparser/sergi_example.f90 new file mode 100644 index 00000000..5300597c --- /dev/null +++ b/src/fparser/sergi_example.f90 @@ -0,0 +1,4 @@ + subroutine field_copy_code() + output(ji,jj) = input(ji,jj) + end subroutine field_copy_code + diff --git a/src/fparser/two/Fortran2003.py b/src/fparser/two/Fortran2003.py index 4ecde5bb..c9af013e 100644 --- a/src/fparser/two/Fortran2003.py +++ b/src/fparser/two/Fortran2003.py @@ -425,10 +425,14 @@ class Declaration_Construct(Base): # R207 | | """ + #subclass_names = ['Comment', 'Derived_Type_Def', 'Entry_Stmt', 'Enum_Def', + # 'Format_Stmt', 'Interface_Block', 'Parameter_Stmt', + # 'Procedure_Declaration_Stmt', 'Specification_Stmt', + # 'Type_Declaration_Stmt', 'Stmt_Function_Stmt'] subclass_names = ['Comment', 'Derived_Type_Def', 'Entry_Stmt', 'Enum_Def', 'Format_Stmt', 'Interface_Block', 'Parameter_Stmt', 'Procedure_Declaration_Stmt', 'Specification_Stmt', - 'Type_Declaration_Stmt', 'Stmt_Function_Stmt'] + 'Type_Declaration_Stmt'] class Execution_Part(BlockBase): # R208 diff --git a/src/fparser/two/Fortran2008.py b/src/fparser/two/Fortran2008.py index e1c14c47..ad1cb8b4 100644 --- a/src/fparser/two/Fortran2008.py +++ b/src/fparser/two/Fortran2008.py @@ -192,7 +192,7 @@ class Declaration_Construct_C1112(Declaration_Construct): # C1112 subclass_names = Declaration_Construct.subclass_names[:] subclass_names.remove('Format_Stmt') subclass_names.remove('Entry_Stmt') - subclass_names.remove('Stmt_Function_Stmt') + #subclass_names.remove('Stmt_Function_Stmt') class Submodule(BlockBase): # R1116 [C1112,C1114]