8009, 8094
};
- static HashSet<int> AllWarningsHashSet;
-
public Report (CompilerContext context, ReportPrinter printer)
{
if (context == null)
- throw new ArgumentNullException ("settings");
+ throw new ArgumentNullException ("context");
if (printer == null)
throw new ArgumentNullException ("printer");
extra_information.Add (msg);
}
- public bool CheckWarningCode (int code, Location loc)
- {
- if (AllWarningsHashSet == null)
- AllWarningsHashSet = new HashSet<int> (AllWarnings);
-
- if (AllWarningsHashSet.Contains (code))
- return true;
-
- Warning (1691, 1, loc, "`{0}' is not a valid warning number", code);
- return false;
- }
-
public void ExtraInformation (Location loc, string msg)
{
extra_information.Add (String.Format ("{0} {1}", loc, msg));
public void WarningDisable (Location location, int code, Report Report)
{
- if (Report.CheckWarningCode (code, location))
- regions.Add (new Disable (location.Row, code));
+ regions.Add (new Disable (location.Row, code));
}
public void WarningEnable (int line)
public void WarningEnable (Location location, int code, CompilerContext context)
{
- if (!context.Report.CheckWarningCode (code, location))
- return;
-
if (context.Settings.IsWarningDisabledGlobally (code))
context.Report.Warning (1635, 1, location, "Cannot restore warning `CS{0:0000}' because it was disabled globally", code);
public bool ProcessWarningsList (string text, Action<int> action)
{
- bool valid = true;
foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {
var warning = wid;
if (warning.Length == 6 && warning [0] == 'C' && warning [1] == 'S')
continue;
}
- if (report.CheckWarningCode (id, Location.Null)) {
- action (id);
- } else {
- report.Error (1904, "`{0}' is not a valid warning number", wid);
- valid = false;
- }
+ action (id);
}
- return valid;
+ return true;
}
void Error_RequiresArgument (string option)