mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-04 19:38:28 +00:00
Trim elements when reading them
Sometimes elements in overrides.xml contain extra spaces due to typos, which are quite difficult to track down. The XmlSpecReader can now cope with that.
This commit is contained in:
parent
513fa728d0
commit
a29e132172
|
@ -244,8 +244,8 @@ namespace Bind
|
||||||
string path = "function";
|
string path = "function";
|
||||||
foreach (XPathNavigator node in specs.SelectChildren(path, String.Empty))
|
foreach (XPathNavigator node in specs.SelectChildren(path, String.Empty))
|
||||||
{
|
{
|
||||||
var name = node.GetAttribute("name", String.Empty);
|
var name = node.GetAttribute("name", String.Empty).Trim();
|
||||||
var version = node.GetAttribute("version", String.Empty);
|
var version = node.GetAttribute("version", String.Empty).Trim();
|
||||||
|
|
||||||
// Ignore functions that have a higher version number than
|
// Ignore functions that have a higher version number than
|
||||||
// our current apiversion. Extensions do not have a version,
|
// our current apiversion. Extensions do not have a version,
|
||||||
|
@ -264,11 +264,11 @@ namespace Bind
|
||||||
{
|
{
|
||||||
d = new Delegate();
|
d = new Delegate();
|
||||||
d.Name = name;
|
d.Name = name;
|
||||||
d.Version = node.GetAttribute("version", String.Empty);
|
d.Version = node.GetAttribute("version", String.Empty).Trim();
|
||||||
d.Category = node.GetAttribute("category", String.Empty);
|
d.Category = node.GetAttribute("category", String.Empty).Trim();
|
||||||
d.DeprecatedVersion = node.GetAttribute("deprecated", String.Empty);
|
d.DeprecatedVersion = node.GetAttribute("deprecated", String.Empty).Trim();
|
||||||
d.Deprecated = !String.IsNullOrEmpty(d.DeprecatedVersion);
|
d.Deprecated = !String.IsNullOrEmpty(d.DeprecatedVersion);
|
||||||
d.Extension = node.GetAttribute("extension", String.Empty) ?? "Core";
|
d.Extension = node.GetAttribute("extension", String.Empty).Trim() ?? "Core";
|
||||||
if (!extensions.Contains(d.Extension))
|
if (!extensions.Contains(d.Extension))
|
||||||
extensions.Add(d.Extension);
|
extensions.Add(d.Extension);
|
||||||
}
|
}
|
||||||
|
@ -278,18 +278,18 @@ namespace Bind
|
||||||
switch (param.Name)
|
switch (param.Name)
|
||||||
{
|
{
|
||||||
case "returns":
|
case "returns":
|
||||||
d.ReturnType.CurrentType = param.GetAttribute("type", String.Empty);
|
d.ReturnType.CurrentType = param.GetAttribute("type", String.Empty).Trim();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "param":
|
case "param":
|
||||||
Parameter p = new Parameter();
|
Parameter p = new Parameter();
|
||||||
p.CurrentType = param.GetAttribute("type", String.Empty);
|
p.CurrentType = param.GetAttribute("type", String.Empty).Trim();
|
||||||
p.Name = param.GetAttribute("name", String.Empty);
|
p.Name = param.GetAttribute("name", String.Empty).Trim();
|
||||||
|
|
||||||
string element_count = param.GetAttribute("elementcount", String.Empty);
|
string element_count = param.GetAttribute("elementcount", String.Empty).Trim();
|
||||||
if (String.IsNullOrEmpty(element_count))
|
if (String.IsNullOrEmpty(element_count))
|
||||||
{
|
{
|
||||||
element_count = param.GetAttribute("count", String.Empty);
|
element_count = param.GetAttribute("count", String.Empty).Trim();
|
||||||
if (!String.IsNullOrEmpty(element_count))
|
if (!String.IsNullOrEmpty(element_count))
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
|
@ -300,7 +300,7 @@ namespace Bind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty));
|
p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty).Trim());
|
||||||
|
|
||||||
d.Parameters.Add(p);
|
d.Parameters.Add(p);
|
||||||
break;
|
break;
|
||||||
|
@ -325,8 +325,8 @@ namespace Bind
|
||||||
{
|
{
|
||||||
Enum e = new Enum()
|
Enum e = new Enum()
|
||||||
{
|
{
|
||||||
Name = node.GetAttribute("name", String.Empty),
|
Name = node.GetAttribute("name", String.Empty).Trim(),
|
||||||
Type = node.GetAttribute("type", String.Empty)
|
Type = node.GetAttribute("type", String.Empty).Trim()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(e.Name))
|
if (String.IsNullOrEmpty(e.Name))
|
||||||
|
@ -346,17 +346,17 @@ namespace Bind
|
||||||
case "token":
|
case "token":
|
||||||
c = new Constant
|
c = new Constant
|
||||||
{
|
{
|
||||||
Name = param.GetAttribute("name", String.Empty),
|
Name = param.GetAttribute("name", String.Empty).Trim(),
|
||||||
Value = param.GetAttribute("value", String.Empty)
|
Value = param.GetAttribute("value", String.Empty).Trim()
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "use":
|
case "use":
|
||||||
c = new Constant
|
c = new Constant
|
||||||
{
|
{
|
||||||
Name = param.GetAttribute("token", String.Empty),
|
Name = param.GetAttribute("token", String.Empty).Trim(),
|
||||||
Reference = param.GetAttribute("enum", String.Empty),
|
Reference = param.GetAttribute("enum", String.Empty).Trim(),
|
||||||
Value = param.GetAttribute("token", String.Empty),
|
Value = param.GetAttribute("token", String.Empty).Trim(),
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue