static void ParseFieldOption(string key, string val, Field f)
{
switch (key) {
case "default":
f.OptionDefault = val;
break;
case "packed":
f.OptionPacked = Boolean.Parse (val);
break;
case "deprecated":
f.OptionDeprecated = Boolean.Parse (val);
break;
//Local options:
case "access":
f.OptionAccess = val;
break;
case "codetype":
if (val == "DateTime" || val == "TimeSpan") {
if (f.ProtoTypeName != "int64")
throw new ProtoFormatException ("DateTime and TimeSpan must be stored in int64. was " + f.ProtoTypeName);
}
f.OptionCodeType = val;
break;
case "generate":
f.OptionGenerate = Boolean.Parse (val);
break;
default:
Console.WriteLine ("Warning: Unknown field option: " + key);
break;
}
}