//
bool process_directives = true;
- // get current status of if blocks.
- bool is_inside_disabled_block ()
- {
- return ifstack != null && ifstack.Count != 0 &&
- ((int) ifstack.Peek ()) & TAKING == 0;
- }
-
//
// if true, then the code continues processing the code
// if false, the code stays in a loop until another directive is
{
string cmd, arg;
bool region_directive = false;
- current_location = new Location (ref_line, Col);
get_cmd_arg (out cmd, out arg);
PreProcessPragma (arg);
return caller_is_taking;
- case "define":
- if (any_token_seen){
- Error_TokensSeen ();
- return true;
- }
- if (caller_is_taking)
- PreProcessDefinition (true, arg);
- return true;
- case "undef":
- if (any_token_seen){
- Error_TokensSeen ();
- return caller_is_taking;
- }
- if (caller_is_taking)
- PreProcessDefinition (false, arg);
+ case "line":
+ if (!PreProcessLine (arg))
+ Report.Error (
+ 1576, Location,
+ "The line number specified for #line directive is missing or invalid");
return caller_is_taking;
case "region":
return ret;
}
- case "line":
- case "error":
- case "warning":
- // processed only when current code block is not disabled.
- break;
- default:
- Report.Error (1024, Location, "Wrong preprocessor directive");
- return caller_is_taking;
}
//
return false;
switch (cmd){
- case "line":
- if (!PreProcessLine (arg))
- Report.Error (
- 1576, Location,
- "The line number specified for #line directive is missing or invalid");
- return caller_is_taking;
+ case "define":
+ if (any_token_seen){
+ Error_TokensSeen ();
+ return true;
+ }
+ PreProcessDefinition (true, arg);
+ return true;
+
+ case "undef":
+ if (any_token_seen){
+ Error_TokensSeen ();
+ return true;
+ }
+ PreProcessDefinition (false, arg);
+ return true;
case "error":
Report.Error (1029, Location, "#error: '" + arg + "'");
Report.Warning (1030, 1, Location, "#warning: `{0}'", arg);
return true;
}
+
+ Report.Error (1024, Location, "Wrong preprocessor directive");
return true;
+
}
private int consume_string (bool quoted)