add interrogate -noangles

This commit is contained in:
David Rose 2011-11-06 18:02:17 +00:00
parent be2657311d
commit cebecba2fc
3 changed files with 21 additions and 5 deletions

View File

@ -186,6 +186,7 @@ get() {
////////////////////////////////////////////////////////////////////
CPPPreprocessor::
CPPPreprocessor() {
_noangles = false;
_state = S_eof;
_paren_nesting = 0;
_angle_bracket_found = false;
@ -1375,7 +1376,12 @@ handle_include_directive(const string &args, int first_line,
}
} else if (expr[0] == '<' && expr[expr.size() - 1] == '>') {
filename = expr.substr(1, expr.size() - 2);
angle_quotes = true;
if (!_noangles) {
// If _noangles is true, we don't make a distinction between
// angle brackets and quote marks--all #include statements are
// treated the same, as if they used quote marks.
angle_quotes = true;
}
okflag = true;
if (_files.size() == 1) {
@ -1396,7 +1402,6 @@ handle_include_directive(const string &args, int first_line,
CPPFile::Source source = CPPFile::S_none;
if (okflag) {
found_file = false;
// Search the current directory.

View File

@ -72,8 +72,9 @@ public:
Manifests _manifests;
pvector<CPPFile::Source> _quote_include_kind;
DSearchPath _quote_include_path;
DSearchPath _angle_include_path;
DSearchPath _quote_include_path;
DSearchPath _angle_include_path;
bool _noangles;
CPPComments _comments;

View File

@ -75,6 +75,7 @@ enum CommandOptions {
CO_longlong,
CO_promiscuous,
CO_spam,
CO_noangles,
CO_help,
};
@ -101,6 +102,7 @@ static struct option long_options[] = {
{ "longlong", required_argument, NULL, CO_longlong },
{ "promiscuous", no_argument, NULL, CO_promiscuous },
{ "spam", no_argument, NULL, CO_spam },
{ "noangles", no_argument, NULL, CO_noangles },
{ "help", no_argument, NULL, CO_help },
{ NULL }
};
@ -275,7 +277,11 @@ void show_help() {
<< " -spam\n"
<< " Generate wrapper functions that report each invocation to Notify.\n"
<< " This can sometimes be useful for tracking down bugs.\n\n";
<< " This can sometimes be useful for tracking down bugs.\n\n"
<< " -noangles\n"
<< " Treat #include <file> the same as #include \"file\". This means -I\n"
<< " and -S are equivalent.\n\n";
}
// handle commandline -D options
@ -429,6 +435,10 @@ main(int argc, char *argv[]) {
generate_spam = true;
break;
case CO_noangles:
parser._noangles = true;
break;
case 'h':
case CO_help:
show_help();