【优化】优化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 ctx = new TemplateContext();
var env = new TTypeTemplateExtends var env = new TTypeTemplateExtends
{ {
["x"] = model ["x"] = model,
["assembly"] = DefAssembly.LocalAssebmly,
}; };
if (extraModels != null) if (extraModels != null)
{ {
@ -34,6 +35,7 @@ namespace Luban.Job.Cfg
{ {
["table"] = table, ["table"] = table,
["datas"] = exportDatas, ["datas"] = exportDatas,
["assembly"] = DefAssembly.LocalAssebmly,
}; };
if (extraModels != null) if (extraModels != null)
{ {

View File

@ -19,8 +19,9 @@ namespace Luban.Job.Common.Utils
{ {
return am; 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); int sepIndex = pair.IndexOfAny(s_attrKeyValueSep);
if (sepIndex >= 0) if (sepIndex >= 0)
{ {
@ -173,7 +174,7 @@ namespace Luban.Job.Common.Utils
case ELanguage.PYTHON: case ELanguage.PYTHON:
case ELanguage.RUST: case ELanguage.RUST:
#if !LUBAN_LITE #if !LUBAN_LITE
return System.Web.HttpUtility.HtmlEncode(comment).Replace("\n", "<br/>"); return System.Web.HttpUtility.HtmlEncode(comment).Replace("\n", "<br/>");
#else #else
throw new NotSupportedException(); throw new NotSupportedException();
#endif #endif