mirror of
https://github.com/nasa/trick.git
synced 2025-01-30 08:03:51 +00:00
parent
a181e92960
commit
6613669989
@ -196,7 +196,11 @@ bool CommentSaver::hasICGNoComment( std::string file_name ) {
|
||||
std::set< std::string > CommentSaver::getIgnoreTypes( std::string file_name ) {
|
||||
std::set< std::string > ignore_types ;
|
||||
std::string th_str = getTrickHeaderComment(file_name) ;
|
||||
if ( ! th_str.empty() ) {
|
||||
|
||||
if ( th_str.empty() ) {
|
||||
return ignore_types;
|
||||
}
|
||||
|
||||
int ret ;
|
||||
regex_t reg_expr ;
|
||||
regmatch_t pmatch[10] ;
|
||||
@ -233,9 +237,7 @@ std::set< std::string > CommentSaver::getIgnoreTypes( std::string file_name ) {
|
||||
regcomp( ®_expr , "(ICG[ _]IGNORE[ _]TYPE(S)?:)" , REG_EXTENDED | REG_ICASE ) ;
|
||||
ret = regexec( ®_expr , th_str.c_str() , 10 , pmatch , 0 ) ;
|
||||
regfree(®_expr) ;
|
||||
if ( ret != 0 ) {
|
||||
return std::set< std::string >() ;
|
||||
}
|
||||
if ( !ret ) {
|
||||
th_str = th_str.substr(pmatch[1].rm_eo) ;
|
||||
|
||||
/* find the end of the ICG_IGNORE_TYPES field */
|
||||
@ -243,9 +245,7 @@ std::set< std::string > CommentSaver::getIgnoreTypes( std::string file_name ) {
|
||||
regcomp( ®_expr , "(\\)\\s*\\))" , REG_EXTENDED ) ;
|
||||
ret = regexec( ®_expr , th_str.c_str() , 10 , pmatch , 0 ) ;
|
||||
regfree(®_expr) ;
|
||||
if ( ret != 0 ) {
|
||||
return std::set< std::string >() ;
|
||||
}
|
||||
if ( !ret ) {
|
||||
th_str = th_str.substr(0 , pmatch[1].rm_so) ;
|
||||
std::replace( th_str.begin(), th_str.end(), '(', ' ');
|
||||
std::replace( th_str.begin(), th_str.end(), ')', ' ');
|
||||
@ -259,7 +259,7 @@ std::set< std::string > CommentSaver::getIgnoreTypes( std::string file_name ) {
|
||||
ignore_types.insert(item) ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return ignore_types ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user