【优化】优化type的attr解析,允许用()来界定属性的定义范围,如int#(set=1,2,3)

【优化】模块中可以通过assembly属性获得DefAssembly变量
main
walon 2021-11-22 16:39:32 +08:00
parent 5e56d35e4a
commit 8cd45782f4
2 changed files with 6 additions and 3 deletions

View File

@ -13,7 +13,8 @@ namespace Luban.Job.Cfg
var ctx = new TemplateContext();
var env = new TTypeTemplateExtends
{
["x"] = model
["x"] = model,
["assembly"] = DefAssembly.LocalAssebmly,
};
if (extraModels != null)
{
@ -34,6 +35,7 @@ namespace Luban.Job.Cfg
{
["table"] = table,
["datas"] = exportDatas,
["assembly"] = DefAssembly.LocalAssebmly,
};
if (extraModels != null)
{

View File

@ -19,8 +19,9 @@ namespace Luban.Job.Common.Utils
{
return am;
}
foreach (var pair in tags.Split(s_attrSep))
foreach (var rawPair in tags.Split(s_attrSep))
{
var pair = TrimBracePairs(rawPair);
int sepIndex = pair.IndexOfAny(s_attrKeyValueSep);
if (sepIndex >= 0)
{