Add Tag parsing in scripting type (for custom extensions)
This commit is contained in:
@@ -524,6 +524,17 @@ namespace Flax.Build.Bindings
|
||||
}
|
||||
}
|
||||
|
||||
private static void ParseTag(ref Dictionary<string, string> tags, TagParameter tag)
|
||||
{
|
||||
if (tags == null)
|
||||
tags = new Dictionary<string, string>();
|
||||
var idx = tag.Value.IndexOf('=');
|
||||
if (idx == -1)
|
||||
tags[tag.Value] = string.Empty;
|
||||
else
|
||||
tags[tag.Value.Substring(0, idx)] = tag.Value.Substring(idx + 1);
|
||||
}
|
||||
|
||||
private static ClassInfo ParseClass(ref ParsingContext context)
|
||||
{
|
||||
var desc = new ClassInfo
|
||||
@@ -608,6 +619,9 @@ namespace Flax.Build.Bindings
|
||||
case "namespace":
|
||||
desc.Namespace = tag.Value;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseTypeTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -693,6 +707,9 @@ namespace Flax.Build.Bindings
|
||||
case "namespace":
|
||||
desc.Namespace = tag.Value;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseTypeTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -824,6 +841,9 @@ namespace Flax.Build.Bindings
|
||||
case "hidden":
|
||||
desc.IsHidden = true;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseMemberTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -1085,6 +1105,9 @@ namespace Flax.Build.Bindings
|
||||
case "namespace":
|
||||
desc.Namespace = tag.Value;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseTypeTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -1156,6 +1179,9 @@ namespace Flax.Build.Bindings
|
||||
case "namespace":
|
||||
desc.Namespace = tag.Value;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseTypeTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -1283,6 +1309,9 @@ namespace Flax.Build.Bindings
|
||||
case "noarray":
|
||||
desc.NoArray = true;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseMemberTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -1349,6 +1378,9 @@ namespace Flax.Build.Bindings
|
||||
case "hidden":
|
||||
desc.IsHidden = true;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseMemberTag?.Invoke(ref valid, tag, desc);
|
||||
@@ -1418,6 +1450,9 @@ namespace Flax.Build.Bindings
|
||||
case "namespace":
|
||||
desc.Namespace = tag.Value;
|
||||
break;
|
||||
case "tag":
|
||||
ParseTag(ref desc.Tags, tag);
|
||||
break;
|
||||
default:
|
||||
bool valid = false;
|
||||
ParseTypeTag?.Invoke(ref valid, tag, desc);
|
||||
|
||||
Reference in New Issue
Block a user