Skip to content

Commit

Permalink
属性描述格式调整
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamanlan committed Oct 30, 2018
1 parent dd6edd5 commit ab6f329
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 2 deletions.
Binary file modified Cs2LuaUtility/bin/Debug/Cs2LuaUtility.dll
Binary file not shown.
Binary file modified Cs2LuaUtility/bin/Debug/Cs2LuaUtility.pdb
Binary file not shown.
6 changes: 4 additions & 2 deletions CsToLua/CsToLuaProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ public static ExitCode Process(string srcFile, string outputDir, string outputEx
StringBuilder nsBuilder = new StringBuilder();
BuildNamespaces(nsBuilder, toplevelMni);
StringBuilder attrBuilder = new StringBuilder();
attrBuilder.AppendLine("__cs2lua__AllAttrs = {};");
BuildAttributes(attrBuilder, compilation.Assembly, ignoredClasses);
StringBuilder enumBuilder = new StringBuilder();
BuildExternEnums(enumBuilder);
Expand Down Expand Up @@ -616,7 +617,8 @@ private static void BuildClassAttributes(StringBuilder sb, INamedTypeSymbol type
foreach (var sym in typesym.GetMembers()) {
var msym = sym as IMethodSymbol;
if (null != msym && msym.GetAttributes().Length > 0 && !ClassInfo.HasAttribute(sym, "Cs2Lua.IgnoreAttribute")) {
temp.AppendFormat("{0}{1} = {{", GetIndentString(indent), sym.Name);
string mname = SymbolTable.Instance.NameMangling(msym);
temp.AppendFormat("{0}{1} = {{", GetIndentString(indent), mname);
temp.AppendLine();
++indent;
BuildAttributes(temp, indent, msym.GetAttributes());
Expand Down Expand Up @@ -662,7 +664,7 @@ private static void BuildClassAttributes(StringBuilder sb, INamedTypeSymbol type
}
--indent;
if (csb.Length > 0) {
sb.AppendFormat("{0}__Attrs = {{", ClassInfo.GetFullName(typesym).Replace(".", "__"));
sb.AppendFormat("__cs2lua__AllAttrs[\"{0}\"] = {{", ClassInfo.GetFullName(typesym));
sb.AppendLine();
sb.Append(csb.ToString());
sb.Append("};");
Expand Down
Binary file modified Test/Cs2LuaScript/bin/Debug/Cs2LuaScript.dll
Binary file not shown.
Binary file modified Test/Cs2LuaScript/bin/Debug/Cs2LuaScript.pdb
Binary file not shown.
Binary file modified Test/Cs2LuaScript/bin/Debug/CustomApi.dll
Binary file not shown.
Binary file modified Test/Cs2LuaScript/bin/Debug/CustomApi.pdb
Binary file not shown.
Binary file modified Test/CustomApi/bin/Debug/CustomApi.dll
Binary file not shown.
Binary file modified Test/CustomApi/bin/Debug/CustomApi.pdb
Binary file not shown.
Binary file modified Test/Tools/Cs2Lua.exe
Binary file not shown.
Binary file modified bin/Debug/Cs2Lua.exe
Binary file not shown.
Binary file modified bin/Debug/Cs2Lua.pdb
Binary file not shown.
Binary file modified bin/Debug/Cs2LuaUtility.dll
Binary file not shown.
Binary file modified bin/Debug/Cs2LuaUtility.pdb
Binary file not shown.

0 comments on commit ab6f329

Please sign in to comment.