- Duplicated attributes (even unknown ones) must result in a parse error.

- Attributes must have a non-empty value.
This commit is contained in:
jfrijters 2011-11-08 06:12:53 +00:00
Родитель 351c13e056
Коммит dd0b8dbc75
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -301,6 +301,7 @@ namespace IKVM.Reflection
} }
else else
{ {
System.Collections.Generic.Dictionary<string, string> unknownAttributes = null;
string[] parts = fullName.Substring(pos).Split(','); string[] parts = fullName.Substring(pos).Split(',');
for (int i = 0; i < parts.Length; i++) for (int i = 0; i < parts.Length; i++)
{ {
@ -351,6 +352,21 @@ namespace IKVM.Reflection
return false; return false;
} }
break; break;
default:
if (kv[1].Trim() == "")
{
return false;
}
if (unknownAttributes == null)
{
unknownAttributes = new System.Collections.Generic.Dictionary<string, string>();
}
if (unknownAttributes.ContainsKey(kv[0].Trim().ToLowerInvariant()))
{
return false;
}
unknownAttributes.Add(kv[0].Trim().ToLowerInvariant(), null);
break;
} }
} }
} }