Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions trick_source/codegen/Interface_Code_Gen/FieldDescription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,17 @@ void FieldDescription::parseComment(std::string comment) {

// The rest of the comment is the description of the variable.

// remove the c comment end marker.
comment = get_regex_field(comment , "(.*)\\*/" , 1) ;
// remove the c comment end marker if present.
// don't overwrite the comment with an empty string
// when there is no "*/" (e.g. // (var_unit) var description)
// to preserve the description of the variable.
// get_regex_field returns an empty string on no match.
{
std::string tmp = get_regex_field(comment , "(.*)\\*/" , 1) ;
if ( ! tmp.empty() ) {
comment = tmp ;
}
}
Comment thread
brendan-nasa marked this conversation as resolved.

// posix c regular expressions are terrible. the regexes above will leave "@" signs because
// the regular expressions are so greedy.
Expand Down
Loading