Skip to content

Commit a0dec86

Browse files
committed
feat(repr): wire repr into module surface and rockspec
1 parent 9d8e653 commit a0dec86

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

mods.rockspec.template

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ description = {
1313
license = "MIT",
1414
summary = "Pure Lua modules",
1515
detailed = [[
16-
Mods provides small, focused Lua modules: List, Set, is, keyword, operator, str, stringcase, tbl, template, and validate.
16+
Mods provides small, focused Lua modules:
17+
List, Set, is, keyword, operator, repr, str, stringcase, tbl, template, and
18+
validate.
1719
]],
1820
}
1921

@@ -29,6 +31,7 @@ build = {
2931
["mods.keyword"] = "src/mods/keyword.lua",
3032
["mods.List"] = "src/mods/List.lua",
3133
["mods.operator"] = "src/mods/operator.lua",
34+
["mods.repr"] = "src/mods/repr.lua",
3235
["mods.Set"] = "src/mods/Set.lua",
3336
["mods.str"] = "src/mods/str.lua",
3437
["mods.stringcase"] = "src/mods/stringcase.lua",

src/mods/init.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local mods = {}
22

3-
([[is keyword List operator Set str stringcase
4-
tbl template utils validate]]):gsub("%S+", function(name)
3+
([[ is keyword List operator repr Set
4+
str stringcase tbl template utils validate ]]):gsub("%S+", function(name)
55
mods[name] = "mods." .. name
66
end)
77

src/mods/repr.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local utils = require("mods.utils")
1+
local mods = require("mods")
22

33
local type = type
44
local next = next
@@ -7,8 +7,8 @@ local sort = table.sort
77
local rep = string.rep
88
local tostring = tostring
99
local gmatch = string.gmatch
10-
local isidentifier = utils.isidentifier
11-
local quote = utils.quote
10+
local isidentifier = mods.keyword.isidentifier
11+
local quote = mods.utils.quote
1212

1313
local INDENT = " "
1414
local TYPE_RANK = { n = 0 }

types/mods.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
---@field keyword mods.keyword
66
---@field List mods.List
77
---@field operator mods.operator
8+
---@field repr mods.repr
89
---@field Set mods.Set
910
---@field str mods.str
1011
---@field stringcase mods.stringcase

0 commit comments

Comments
 (0)