diff options
Diffstat (limited to 'src/base/table.lua')
-rw-r--r-- | src/base/table.lua | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/base/table.lua b/src/base/table.lua index 3076cb0..93cae03 100644 --- a/src/base/table.lua +++ b/src/base/table.lua @@ -3,7 +3,7 @@ -- Additions to Lua's built-in table functions. -- Copyright (c) 2002-2008 Jason Perkins and the Premake project -- - + -- -- Returns true if the table contains the specified value. @@ -17,8 +17,8 @@ end return false end - - + + -- -- Enumerates an array of objects and returns a new table containing -- only the value of one particular field. @@ -31,8 +31,8 @@ end return result end - - + + -- -- Flattens a hierarchy of tables into a single array containing all @@ -41,7 +41,7 @@ function table.flatten(arr) local result = { } - + local function flatten(arr) for _, v in ipairs(arr) do if type(v) == "table" then @@ -51,7 +51,7 @@ end end end - + flatten(arr) return result end @@ -75,7 +75,7 @@ -- -- Inserts a value of array of values into a table. If the value is --- itself a table, its contents are enumerated and added instead. So +-- itself a table, its contents are enumerated and added instead. So -- these inputs give these outputs: -- -- "x" -> { "x" } @@ -154,7 +154,7 @@ end return result end - + -- @@ -177,5 +177,4 @@ end return result end - -
\ No newline at end of file + |