mirror of
https://github.com/nasa/trick.git
synced 2025-02-20 17:22:52 +00:00
Support new Trick comment tags
Changed parenthesis to curly brace... er I mean curly bracket. Well too late, in the code I called it curly brace. It's these "{}". Oh well. Also found that the dependency_only headers were not actually reading the dependencies. Added the list of dependency only files to the list of files to get dependencies from. refs #114
This commit is contained in:
parent
9a969903b6
commit
94a99fb9ea
@ -74,6 +74,10 @@ if ( $any_deps_changed == 0 ) {
|
||||
open FILE, "build/ICG_processed" or die 'cannot open build/ICG_processed' ;
|
||||
my (@top_file_names) = <FILE> ;
|
||||
close FILE ;
|
||||
open FILE, "build/ICG_no_found" or die 'cannot open build/ICG_no_found' ;
|
||||
my (@ICG_no_file_names) = <FILE> ;
|
||||
close FILE ;
|
||||
push @top_file_names , @ICG_no_file_names ;
|
||||
open FILE, "build/S_define.lib_deps" or die 'cannot open build/S_define.lib_deps' ;
|
||||
my (@s_define_lib_deps) = <FILE> ;
|
||||
close FILE ;
|
||||
|
@ -18,7 +18,7 @@ sub get_lib_deps ($$) {
|
||||
|
||||
|
||||
# Doxygen style
|
||||
@lib_list = ($contents =~ /(?:@|\\)trick_li(?:nk|b)_dependency\s*\(\s*(.*?)\s*\)/gs) ;
|
||||
@lib_list = ($contents =~ /(?:@|\\)trick_li(?:nk|b)_dependency\s*{\s*(.*?)\s*}/gs) ;
|
||||
|
||||
# Classic style
|
||||
# library dependency regular expression will match all the way through last parenthesis followed by
|
||||
|
@ -83,18 +83,18 @@ void CommentSaver::getICGField( std::string file_name ) {
|
||||
size_t trick_parse_everything = th_str.find("everything", trick_parse_keyword) ;
|
||||
size_t trick_parse_attributes = th_str.find("attributes", trick_parse_keyword) ;
|
||||
size_t trick_parse_dep_only = th_str.find("dependencies_only", trick_parse_keyword) ;
|
||||
size_t closing_paren = th_str.find(")", trick_parse_keyword) ;
|
||||
if ( closing_paren != std::string::npos ) {
|
||||
size_t closing_brace = th_str.find("}", trick_parse_keyword) ;
|
||||
if ( closing_brace != std::string::npos ) {
|
||||
if ( trick_parse_everything != std::string::npos and
|
||||
trick_parse_everything < closing_paren ) {
|
||||
trick_parse_everything < closing_brace ) {
|
||||
icg_no_comment_found[file_name] = false ;
|
||||
icg_no_found[file_name] = false ;
|
||||
} else if ( trick_parse_attributes != std::string::npos and
|
||||
trick_parse_attributes < closing_paren ) {
|
||||
trick_parse_attributes < closing_brace ) {
|
||||
icg_no_comment_found[file_name] = true ;
|
||||
icg_no_found[file_name] = false ;
|
||||
} else if ( trick_parse_dep_only != std::string::npos and
|
||||
trick_parse_dep_only < closing_paren ) {
|
||||
trick_parse_dep_only < closing_brace ) {
|
||||
icg_no_comment_found[file_name] = false ;
|
||||
icg_no_found[file_name] = true ;
|
||||
} else {
|
||||
@ -198,13 +198,13 @@ std::set< std::string > CommentSaver::getIgnoreTypes( std::string file_name ) {
|
||||
start += strlen("trick_exclude_typename") ;
|
||||
std::string temp_str = th_str.substr(start) ;
|
||||
memset(pmatch , 0 , sizeof(pmatch)) ;
|
||||
ret = regcomp( ®_expr , "^\\s*\\(\\s*(\\S+)\\s*\\)" , REG_EXTENDED ) ;
|
||||
ret = regcomp( ®_expr , "^\\s*\\{\\s*(\\S+)\\s*\\}" , REG_EXTENDED ) ;
|
||||
ret = regexec( ®_expr , temp_str.c_str() , 10 , pmatch , 0 ) ;
|
||||
regfree(®_expr) ;
|
||||
if ( ret == 0 ) {
|
||||
std::string item = temp_str.substr(pmatch[1].rm_so, pmatch[1].rm_eo) ;
|
||||
// regular expression leaving trailing space and parenthesis. Why?
|
||||
item.erase(item.find_first_of(" \t)")) ;
|
||||
// regular expression leaving trailing space and brace. Why?
|
||||
item.erase(item.find_first_of(" \t}")) ;
|
||||
//std::cout << "[31micg_ignore_types[00m " << item << std::endl ;
|
||||
ignore_types.insert(item) ;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user