diff options
| author | OpportunityLiu <[email protected]> | 2019-07-14 00:08:05 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-07-14 00:08:05 +0800 |
| commit | 612280f59e52f7108e87fa782ce8939fb4e80ec6 (patch) | |
| tree | a011600e09d12e2087e18e06766357f33bebd3ae /xmake/core/base/dump.lua | |
| parent | d5489da5f95a1ce5a39c3a40d5ef77729cbb6e1f (diff) | |
add comments
Diffstat (limited to 'xmake/core/base/dump.lua')
| -rw-r--r-- | xmake/core/base/dump.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/core/base/dump.lua b/xmake/core/base/dump.lua index 4cf76f115..1fe5f1f20 100644 --- a/xmake/core/base/dump.lua +++ b/xmake/core/base/dump.lua @@ -35,6 +35,7 @@ function dump._format(fmtkey, fmtdefault, ...) end end +-- translate string with theme formats function dump._translate(str) return colors.translate(str, { patch_reset = false, ignore_unknown = true }) end @@ -125,6 +126,7 @@ function dump._print_reference(value) io.write(dump._translate("${color.dump.reference}"), dump._format("text.dump.reference", "*%s", value), dump._translate("${reset}")) end +-- print anchor and store to printed_set function dump._print_table_anchor(value, printed_set) printed_set.len = printed_set.len + 1 io.write(" ") @@ -132,6 +134,7 @@ function dump._print_table_anchor(value, printed_set) printed_set[value] = printed_set.len end +-- print metatable of value function dump._print_metatable(value, metatable, inner_indent, printed_set, print_archor) if not metatable then return false @@ -252,6 +255,7 @@ function dump._print_table(value, first_indent, remain_indent, printed_set) end if first_level then + -- print metatable first_value = not dump._print_metatable(value, metatable, inner_indent, printed_set, true) end |
