New patch for the empty line issue with Fortran in Scorep 2.0.0.
This commit is contained in:
parent
024c69674f
commit
ac1d66c880
1 changed files with 45 additions and 31 deletions
|
@ -1,42 +1,56 @@
|
||||||
Index: src/opari/opari2_parser_f.cc
|
Index: src/opari/opari2_parser_f.cc
|
||||||
===================================================================
|
===================================================================
|
||||||
--- src/opari/opari2_parser_f.cc (revision 1748)
|
--- src/opari/opari2_parser_f.cc (revision 1749)
|
||||||
+++ src/opari/opari2_parser_f.cc (working copy)
|
+++ src/opari/opari2_parser_f.cc (working copy)
|
||||||
@@ -304,6 +304,12 @@
|
@@ -763,11 +763,13 @@
|
||||||
return result;
|
lines.push_back( m_lowline );
|
||||||
}
|
|
||||||
|
|
||||||
+bool
|
bool found_continuation_line;
|
||||||
+OPARI2_FortranParser::is_empty_line( void )
|
- string prev_sentinel = m_sentinel;
|
||||||
+{
|
- unsigned ignored_lines = 0;
|
||||||
+ return m_lowline.find_first_not_of( " \t" ) == string::npos;
|
+ bool last_was_continuation_line = false;
|
||||||
+}
|
+ string prev_sentinel = m_sentinel;
|
||||||
+
|
+ unsigned ignored_lines = 0;
|
||||||
/**@brief check if this line is a comment line*/
|
do
|
||||||
bool
|
{
|
||||||
OPARI2_FortranParser::is_comment_line( void )
|
- found_continuation_line = false;
|
||||||
@@ -816,7 +822,7 @@
|
+ last_was_continuation_line = found_continuation_line;
|
||||||
|
+ found_continuation_line = false;
|
||||||
|
|
||||||
|
if ( m_options.form == F_FREE )
|
||||||
|
{
|
||||||
|
@@ -778,7 +780,7 @@
|
||||||
|
--com;
|
||||||
|
}
|
||||||
|
string::size_type amp = m_lowline.find_last_not_of( " \t", com );
|
||||||
|
- if ( m_lowline[ amp ] == '&' )
|
||||||
|
+ if ( m_lowline[ amp ] == '&' || ( is_empty_line() && last_was_continuation_line ) )
|
||||||
|
{
|
||||||
|
found_continuation_line = true;
|
||||||
|
}
|
||||||
|
@@ -822,8 +824,15 @@
|
||||||
found_continuation_line = true;
|
found_continuation_line = true;
|
||||||
m_sentinel = prev_sentinel;
|
m_sentinel = prev_sentinel;
|
||||||
}
|
}
|
||||||
- else if ( found_continuation_line )
|
- else if ( found_continuation_line && !is_empty_line() )
|
||||||
+ else if ( found_continuation_line && !is_empty_line() )
|
+ else if ( is_empty_line() && last_was_continuation_line && m_options.form == F_FREE )
|
||||||
{
|
{
|
||||||
|
+ found_continuation_line = true;
|
||||||
|
+ lines.push_back( m_lowline );
|
||||||
|
+ m_sentinel = prev_sentinel;
|
||||||
|
+ ignored_lines--;
|
||||||
|
+ }
|
||||||
|
+ else if ( found_continuation_line )
|
||||||
|
+ {
|
||||||
cerr << m_curr_file << ":" << m_lineno - 1
|
cerr << m_curr_file << ":" << m_lineno - 1
|
||||||
<< ": ERROR: missing continuation line\n";
|
<< ": ERROR: missing continuation line\n";
|
||||||
Index: src/opari/opari2_parser_f.h
|
cleanup_and_exit();
|
||||||
===================================================================
|
@@ -840,7 +849,6 @@
|
||||||
--- src/opari/opari2_parser_f.h (revision 1748)
|
OPARI2_Directive* d_new =
|
||||||
+++ src/opari/opari2_parser_f.h (working copy)
|
NewDirective( lines, directive_prefix, m_options.lang, m_curr_file,
|
||||||
@@ -98,6 +98,10 @@
|
m_lineno - lines.size() - ignored_lines + 1 );
|
||||||
bool
|
-
|
||||||
is_sub_unit_header( void );
|
if ( d_new )
|
||||||
|
{
|
||||||
+/**@brief check if this line is empty*/
|
m_waitfor_loopstart = d_new->NeedsEndLoopDirective();
|
||||||
+ bool
|
|
||||||
+ is_empty_line( void );
|
|
||||||
+
|
|
||||||
/**@brief check if this line is a comment line*/
|
|
||||||
bool
|
|
||||||
is_comment_line( void );
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue