diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml
deleted file mode 100644
index 484a51b..0000000
--- a/.github/workflows/spec.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-name: spec
-
-on:
- push:
- branches: [ '*' ]
- pull_request:
- branches: [ 'master' ]
-
-jobs:
- test:
- strategy:
- fail-fast: false
- matrix:
- lua-version: ["5.4", "5.3", "5.2", "5.1", "luajit"]
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
-
- - uses: leafo/gh-actions-lua@v8.0.0
- with:
- luaVersion: ${{ matrix.lua-version }}
-
- - uses: leafo/gh-actions-luarocks@v4.0.0
-
- - name: install
- run: |
- sudo apt-get install -y libyaml-dev
- luarocks install ansicolors
- luarocks install ldoc
- luarocks install luacov
- luarocks install specl
-
- - name: build
- run: |
- make all doc
- luarocks make
-
- - name: test
- run: |
- make check SPECL_OPTS='-vfreport --coverage'
- bash <(curl -s https://codecov.io/bash) -f luacov.report.out
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index ad4e629..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-*~
-.DS_Store
-/*.src.rock
-/build-aux/config.ld
-/doc
-/lib/std/_debug/version.lua
-/luacov.*.out
-/stdlib-*.tar.gz
diff --git a/.luacov b/.luacov
deleted file mode 100644
index bc99252..0000000
--- a/.luacov
+++ /dev/null
@@ -1,45 +0,0 @@
-return {
- -- filename to store stats collected
- ["statsfile"] = "luacov.stats.out",
-
- -- filename to store report
- ["reportfile"] = "luacov.report.out",
-
- -- luacov.stats file updating frequency.
- -- The lower this value - the more frequenty results will be written out to luacov.stats
- -- You may want to reduce this value for short lived scripts (to for example 2) to avoid losing coverage data.
- ["savestepsize"] = 100,
-
- -- Run reporter on completion? (won't work for ticks)
- runreport = true,
-
- -- Delete stats file after reporting?
- deletestats = false,
-
- -- Process Lua code loaded from raw strings
- -- (that is, when the 'source' field in the debug info
- -- does not start with '@')
- codefromstrings = false,
-
- -- Patterns for files to include when reporting
- -- all will be included if nothing is listed
- -- (exclude overrules include, do not include
- -- the .lua extension, path separator is always '/')
- ["include"] = {
- "lib/std/_debug/init$",
- "lib/std/_debug/version$",
- },
-
- -- Patterns for files to exclude when reporting
- -- all will be included if nothing is listed
- -- (exclude overrules include, do not include
- -- the .lua extension, path separator is always '/')
- ["exclude"] = {
- "luacov$",
- "luacov/reporter$",
- "luacov/defaults$",
- "luacov/runner$",
- "luacov/stats$",
- "luacov/tick$",
- },
-}
diff --git a/AUTHORS.md b/AUTHORS.md
deleted file mode 100644
index 2ae6d04..0000000
--- a/AUTHORS.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# `std._debug`'s contributors
-
-This file lists major contributors to `std._debug`. If you think you
-should be on it, please raise a [github][] issue. Thanks also to all
-those who contribute bug fixes, suggestions and support.
-
-Gary V. Vaughan maintains `std._normalize`, having rewritten and
-reorganised the original code from [lua-stdlib][], in addition to
-to adding new functionality.
-
-Reuben Thomas started the standard libraries project, which included the
-original implementation of some of the functions now distributed with
-this package.
-
-[github]: https://github.com/lua-stdlib/_debug/issues
-[lua-stdlib]: https://github.com/lua-stdlib/lua-stdlib
diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index ba25d55..0000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (C) 2002-2023 `std._debug` authors
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of the Software,
-and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGE-
-MENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 9d89ac1..0000000
--- a/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-# Debug Hints Library for Lua 5.1, 5.2, 5.3 & 5.4
-# Copyright (C) 2002-2023 std._debug authors
-
-LDOC = ldoc
-LUA = lua
-MKDIR = mkdir -p
-SED = sed
-SPECL = specl
-
-VERSION = git
-
-luadir = lib/std/_debug
-SOURCES = \
- $(luadir)/init.lua \
- $(luadir)/version.lua \
- $(NOTHING_ELSE)
-
-
-all: $(luadir)/version.lua
-
-
-$(luadir)/version.lua: .FORCE
- @echo 'return "Debug hints library / $(VERSION)"' > '$@T'; \
- if cmp -s '$@' '$@T'; then \
- rm -f '$@T'; \
- else \
- echo 'echo return "Debug hints library / $(VERSION)" > $@'; \
- mv '$@T' '$@'; \
- fi
-
-doc: build-aux/config.ld $(SOURCES)
- $(LDOC) -c build-aux/config.ld .
-
-build-aux/config.ld: build-aux/config.ld.in
- $(SED) -e "s,@PACKAGE_VERSION@,$(VERSION)," '$<' > '$@'
-
-
-CHECK_ENV = LUA=$(LUA)
-
-check: $(SOURCES)
- LUA=$(LUA) $(SPECL) $(SPECL_OPTS) spec/*_spec.yaml
-
-
-.FORCE:
diff --git a/NEWS.md b/NEWS.md
deleted file mode 100644
index 07be2e0..0000000
--- a/NEWS.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# Stdlib NEWS - User visible changes
-
-## Noteworthy changes in release ?.? (????-??-??) [?]
-
-### Bug fixes
-
- - Correct self arguments in metamethod declarations.
-
-
-## Noteworthy changes in release 1.0.1 (2018-09-22) [stable]
-
-### New Features
-
- - Initial support for Lua 5.4.
-
-
-## Noteworthy changes in release 1.0 (2017-10-14) [stable]
-
-### New features (since lua-stdlib-41.2)
-
- - Initial release, now separated out from lua-stdlib.
-
- - An entirely new API, which does not use global `_DEBUG` at all.
diff --git a/README.md b/README.md
deleted file mode 100644
index bf0cd5b..0000000
--- a/README.md
+++ /dev/null
@@ -1,87 +0,0 @@
-Debug Hints Library
-===================
-
-Copyright (C) 2002-2023 [std._debug authors][authors]
-
-[](http://mit-license.org)
-[](https://github.com/lua-stdlib/_debug/actions)
-[](https://codecov.io/gh/lua-stdlib/_debug)
-
-
-This is a debug hints management library for Lua 5.1 (including LuaJIT),
-5.2, 5.3 and 5.4. The library is copyright by its authors (see the [AUTHORS][]
-file for details), and released under the [MIT license][mit] (the same
-license as Lua itself). There is no warranty.
-
-`std._debug` has no run-time prerequisites beyond a standard Lua system.
-
-[authors]: http://github.com/lua-stdlib/_debug/blob/master/AUTHORS.md
-[github]: http://github.com/lua-stdlib/_debug/ "Github repository"
-[lua]: http://www.lua.org "The Lua Project"
-[mit]: http://mit-license.org "MIT License"
-
-
-Installation
-------------
-
-The simplest and best way to install this library is with [LuaRocks][].
-To install the latest release (recommended):
-
-```bash
- luarocks install std._debug
-```
-
-To install current git master (for testing, before submitting a bug
-report for example):
-
-```bash
- luarocks install http://raw.githubusercontent.com/lua-stdlib/_debug/master/stdlib-git-1.rockspec
-```
-
-The best way to install without [LuaRocks][] is to copy the `std`
-folder and its contents into a directory on your package search path.
-
-[luarocks]: http://www.luarocks.org "Lua package manager"
-
-
-Documentation
--------------
-
-The latest release of these libraries is [documented in LDoc][github.io].
-Pre-built HTML files are included in the release.
-
-[github.io]: http://lua-stdlib.github.io/_debug
-
-
-Bug reports and code contributions
-----------------------------------
-
-These libraries are written and maintained by their users.
-
-Please make bug reports and suggestions as [GitHub Issues][issues].
-Pull requests are especially appreciated.
-
-But first, please check that your issue has not already been reported by
-someone else, and that it is not already fixed by [master][github] in
-preparation for the next release (see Installation section above for how
-to temporarily install master with [LuaRocks][]).
-
-There is no strict coding style, but please bear in mind the following
-points when proposing changes:
-
-0. Follow existing code. There are a lot of useful patterns and avoided
- traps there.
-
-1. 3-character indentation using SPACES in Lua sources: It makes rogue
- TABS easier to see, and lines up nicely with 'if' and 'end' keywords.
-
-2. Simple strings are easiest to type using single-quote delimiters,
- saving double-quotes for where a string contains apostrophes.
-
-3. Save horizontal space by only using SPACES where the parser requires
- them.
-
-4. Use vertical space to separate out compound statements to help the
- coverage reports discover untested lines.
-
-[issues]: http://github.com/lua-stdlib/_debug/issues
diff --git a/build-aux/config.ld.in b/build-aux/config.ld.in
deleted file mode 100644
index 7ed145e..0000000
--- a/build-aux/config.ld.in
+++ /dev/null
@@ -1,29 +0,0 @@
---[[
- Debug Hints Library for Lua 5.1, 5.2, 5.3 & 5.4
- Copyright (C) 2002-2023 std._debug authors
-]]
-
-title = 'std._debug @PACKAGE_VERSION@ Reference'
-project = 'std._debug @PACKAGE_VERSION@'
-description = [[
-# Debug Settings Library for Lua
-
-This is a light-weight debug hints management library for Lua 5.1
-(including LuaJIT), 5.2, 5.3 and 5.4 written in pure Lua.
-
-## LICENSE
-
-The code is copyright by its respective authors, and released under the
-MIT license (the same license as Lua itself). There is no warranty.
-]]
-
-dir = '../doc'
-
-file = {
- '../lib/std/_debug/init.lua',
-}
-
-
-format = 'markdown'
-backtick_references = false
-sort = false
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..e56d061
--- /dev/null
+++ b/index.html
@@ -0,0 +1,234 @@
+
+
+
+
Set or change all the debug substate hints by calling the returned
+ module functable with no argument to reset to defaults; with true
+ to set all substate hints into development mode, or false for
+ production mode.
+
+
+
+local _debug = require'std._debug'(false)
+
+
+
Query substate hints by indexing the returned module functable keys:
+
+
+
+local isstrict = _debug.strict
+
+
+
Beware that even though you can change std._debug state at any time,
+ stdlib libraries in particular (but probably other clients too) are
+ configured at load time according to the state at the time they are
+ required - e.g. changing _debug.strict after require 'std' does not
+ affect the strict environment already created for the 'std' module
+ when it was previously loaded.
-- Enable all debugging substates
+local _debug = require'std._debug'(true)
+
+
+
+
+
+ __index (name)
+
+
+ Lazy loading of std._debug modules.
+ Don't load everything on initial startup, wait until first attempt
+ to access a submodule, and then load it on demand.
+
+
+
the submodule that was loaded to satisfy the missing
+
`name`, otherwise `nil` if nothing was found
+
+
+
+
+
+
+
Usage:
+
+
local version = require'std._debug'.version
+
+
+
+
+
Types
+
+
+
+
+ Substates
+
+
+ Builtin debug substate hints.
+
+
Use __call metamethod to set all substate hints at once.
+ Note that none of the debugging features required to implement these
+ hints are encoded here, this module is merely a central location to
+ record systemwide hint; other modules you load subsequently may or may
+ not choose to behave according to their content.
+
+
+
Fields:
+
+
argcheck
+ bool
+ true if runtime argument checking is desired
+ (default true)
+
+
deprecate
+ bool
+ nil if deprecated api warnings are desired;
+ false if deprecated apis without warnings are desired; true if
+ removal of deprecated apis is preferred
+ (optional)
+
+
level
+ int
+ debugging level
+ (default 1)
+
+
strict
+ bool
+ true if strict enforcement of variable declaration
+ before use is desired
+ (default true)
+
+
+
+
+
+
+
Usage:
+
+
require'std._debug'.argcheck = false
+
+
+
+
+
+
+
+
+
+generated by LDoc 1.4.6
+Last updated 2018-09-22 16:00:27
+
+
+
+
diff --git a/ldoc.css b/ldoc.css
new file mode 100644
index 0000000..52c4ad2
--- /dev/null
+++ b/ldoc.css
@@ -0,0 +1,303 @@
+/* BEGIN RESET
+
+Copyright (c) 2010, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.html
+version: 2.8.2r1
+*/
+html {
+ color: #000;
+ background: #FFF;
+}
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td {
+ margin: 0;
+ padding: 0;
+}
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+fieldset,img {
+ border: 0;
+}
+address,caption,cite,code,dfn,em,strong,th,var,optgroup {
+ font-style: inherit;
+ font-weight: inherit;
+}
+del,ins {
+ text-decoration: none;
+}
+li {
+ margin-left: 20px;
+}
+caption,th {
+ text-align: left;
+}
+h1,h2,h3,h4,h5,h6 {
+ font-size: 100%;
+ font-weight: bold;
+}
+q:before,q:after {
+ content: '';
+}
+abbr,acronym {
+ border: 0;
+ font-variant: normal;
+}
+sup {
+ vertical-align: baseline;
+}
+sub {
+ vertical-align: baseline;
+}
+legend {
+ color: #000;
+}
+input,button,textarea,select,optgroup,option {
+ font-family: inherit;
+ font-size: inherit;
+ font-style: inherit;
+ font-weight: inherit;
+}
+input,button,textarea,select {*font-size:100%;
+}
+/* END RESET */
+
+body {
+ margin-left: 1em;
+ margin-right: 1em;
+ font-family: arial, helvetica, geneva, sans-serif;
+ background-color: #ffffff; margin: 0px;
+}
+
+code, tt { font-family: monospace; font-size: 1.1em; }
+span.parameter { font-family:monospace; }
+span.parameter:after { content:":"; }
+span.types:before { content:"("; }
+span.types:after { content:")"; }
+.type { font-weight: bold; font-style:italic }
+
+body, p, td, th { font-size: .95em; line-height: 1.2em;}
+
+p, ul { margin: 10px 0 0 0px;}
+
+strong { font-weight: bold;}
+
+em { font-style: italic;}
+
+h1 {
+ font-size: 1.5em;
+ margin: 20px 0 20px 0;
+}
+h2, h3, h4 { margin: 15px 0 10px 0; }
+h2 { font-size: 1.25em; }
+h3 { font-size: 1.15em; }
+h4 { font-size: 1.06em; }
+
+a:link { font-weight: bold; color: #004080; text-decoration: none; }
+a:visited { font-weight: bold; color: #006699; text-decoration: none; }
+a:link:hover { text-decoration: underline; }
+
+hr {
+ color:#cccccc;
+ background: #00007f;
+ height: 1px;
+}
+
+blockquote { margin-left: 3em; }
+
+ul { list-style-type: disc; }
+
+p.name {
+ font-family: "Andale Mono", monospace;
+ padding-top: 1em;
+}
+
+pre {
+ background-color: rgb(245, 245, 245);
+ border: 1px solid #C0C0C0; /* silver */
+ padding: 10px;
+ margin: 10px 0 10px 0;
+ overflow: auto;
+ font-family: "Andale Mono", monospace;
+}
+
+pre.example {
+ font-size: .85em;
+}
+
+table.index { border: 1px #00007f; }
+table.index td { text-align: left; vertical-align: top; }
+
+#container {
+ margin-left: 1em;
+ margin-right: 1em;
+ background-color: #f0f0f0;
+}
+
+#product {
+ text-align: center;
+ border-bottom: 1px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#product big {
+ font-size: 2em;
+}
+
+#main {
+ background-color: #f0f0f0;
+ border-left: 2px solid #cccccc;
+}
+
+#navigation {
+ float: left;
+ width: 14em;
+ vertical-align: top;
+ background-color: #f0f0f0;
+ overflow: visible;
+}
+
+#navigation h2 {
+ background-color:#e7e7e7;
+ font-size:1.1em;
+ color:#000000;
+ text-align: left;
+ padding:0.2em;
+ border-top:1px solid #dddddd;
+ border-bottom:1px solid #dddddd;
+}
+
+#navigation ul
+{
+ font-size:1em;
+ list-style-type: none;
+ margin: 1px 1px 10px 1px;
+}
+
+#navigation li {
+ text-indent: -1em;
+ display: block;
+ margin: 3px 0px 0px 22px;
+}
+
+#navigation li li a {
+ margin: 0px 3px 0px -1em;
+}
+
+#content {
+ margin-left: 14em;
+ padding: 1em;
+ width: 700px;
+ border-left: 2px solid #cccccc;
+ border-right: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+#about {
+ clear: both;
+ padding: 5px;
+ border-top: 2px solid #cccccc;
+ background-color: #ffffff;
+}
+
+@media print {
+ body {
+ font: 12pt "Times New Roman", "TimeNR", Times, serif;
+ }
+ a { font-weight: bold; color: #004080; text-decoration: underline; }
+
+ #main {
+ background-color: #ffffff;
+ border-left: 0px;
+ }
+
+ #container {
+ margin-left: 2%;
+ margin-right: 2%;
+ background-color: #ffffff;
+ }
+
+ #content {
+ padding: 1em;
+ background-color: #ffffff;
+ }
+
+ #navigation {
+ display: none;
+ }
+ pre.example {
+ font-family: "Andale Mono", monospace;
+ font-size: 10pt;
+ page-break-inside: avoid;
+ }
+}
+
+table.module_list {
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.module_list td {
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.module_list td.name { background-color: #f0f0f0; min-width: 200px; }
+table.module_list td.summary { width: 100%; }
+
+
+table.function_list {
+ border-width: 1px;
+ border-style: solid;
+ border-color: #cccccc;
+ border-collapse: collapse;
+}
+table.function_list td {
+ border-width: 1px;
+ padding: 3px;
+ border-style: solid;
+ border-color: #cccccc;
+}
+table.function_list td.name { background-color: #f0f0f0; min-width: 200px; }
+table.function_list td.summary { width: 100%; }
+
+ul.nowrap {
+ overflow:auto;
+ white-space:nowrap;
+}
+
+dl.table dt, dl.function dt {border-top: 1px solid #ccc; padding-top: 1em;}
+dl.table dd, dl.function dd {padding-bottom: 1em; margin: 10px 0 0 20px;}
+dl.table h3, dl.function h3 {font-size: .95em;}
+
+/* stop sublists from having initial vertical space */
+ul ul { margin-top: 0px; }
+ol ul { margin-top: 0px; }
+ol ol { margin-top: 0px; }
+ul ol { margin-top: 0px; }
+
+/* make the target distinct; helps when we're navigating to a function */
+a:target + * {
+ background-color: #FF9;
+}
+
+
+/* styles for prettification of source */
+pre .comment { color: #558817; }
+pre .constant { color: #a8660d; }
+pre .escape { color: #844631; }
+pre .keyword { color: #aa5050; font-weight: bold; }
+pre .library { color: #0e7c6b; }
+pre .marker { color: #512b1e; background: #fedc56; font-weight: bold; }
+pre .string { color: #8080ff; }
+pre .number { color: #f8660d; }
+pre .operator { color: #2239a8; font-weight: bold; }
+pre .preprocessor, pre .prepro { color: #a33243; }
+pre .global { color: #800080; }
+pre .user-keyword { color: #800080; }
+pre .prompt { color: #558817; }
+pre .url { color: #272fc2; text-decoration: underline; }
+
diff --git a/lib/std/_debug/init.lua b/lib/std/_debug/init.lua
deleted file mode 100644
index fb897e0..0000000
--- a/lib/std/_debug/init.lua
+++ /dev/null
@@ -1,115 +0,0 @@
---[[
- Debug Hints Library for Lua 5.1, 5.2, 5.3 & 5.4
- Copyright (C) 2002-2023 std._debug authors
-]]
---[[--
- Manage debug mode, and associated substate hints.
-
- Set or change all the debug substate hints by calling the returned
- module functable with no argument to reset to defaults; with `true`
- to set all substate hints into development mode, or `false` for
- production mode.
-
- local _debug = require 'std._debug'(false)
-
- Query substate hints by indexing the returned module functable keys:
-
- local isstrict = _debug.strict
-
- Beware that even though you can change std._debug state at any time,
- stdlib libraries in particular (but probably other clients too) are
- configured at load time according to the state at the time they are
- required - e.g. changing _debug.strict after require 'std' does not
- affect the strict environment already created for the 'std' module
- when it was previously loaded.
-
- @module std._debug
-]]
-
-
-
-local _DEBUG = 'default'
-
-
---- Nothing!
-local spec = {
- argcheck = { default=true, safe=true, fast=false},
- deprecate = { default=nil, safe=true, fast=false},
- level = { default=1, safe=1, fast=math.huge},
- strict = { default=true, safe=true, fast=false},
-}
-
-
-local metatable = {
- --- Metamethods
- -- @section metamethods
-
- --- Change the all builtin debug hints.
- -- @function __call
- -- @bool[opt] enable or disable all debugging substate hints
- -- @treturn Substates substates
- -- @usage
- -- -- Enable all debugging substates
- -- local _debug = require 'std._debug'(true)
- __call = function(self, x)
- if x == true then
- _DEBUG = 'safe'
- elseif x == false then
- _DEBUG = 'fast'
- elseif x == nil then
- _DEBUG = 'default'
- else
- error("bad argument #1 to '_debug' (boolean or nil expected, got " .. type(x) .. ')', 2)
- end
- return self
- end,
-
- --- Lazy loading of std._debug modules.
- -- Don't load everything on initial startup, wait until first attempt
- -- to access a submodule, and then load it on demand.
- -- @function __index
- -- @string name submodule name
- -- @treturn table|nil the submodule that was loaded to satisfy the missing
- -- `name`, otherwise `nil` if nothing was found
- -- @usage
- -- local version = require 'std._debug'.version
- __index = function(_, name)
- local v = spec[name]
- if type(v) == 'table' then
- return v[_DEBUG]
- elseif v ~= nil then
- return v
- end
- local ok, r = pcall(require, 'std._debug.' .. name)
- if ok then
- spec[name] = r
- return r
- end
- end,
-}
-
-
-return setmetatable({}, metatable)
-
-
---- Types
--- @section types
-
---- Builtin debug substate hints.
---
--- Use `__call` metamethod to set all substate hints at once.
--- Note that none of the debugging features required to implement these
--- hints are encoded here, this module is merely a central location to
--- record systemwide hint; other modules you load subsequently may or may
--- not choose to behave according to their content.
--- @table Substates
--- @bool[opt=true] argcheck `true` if runtime argument checking is desired
--- @bool[opt] deprecate `nil` if deprecated api warnings are desired;
--- `false` if deprecated apis without warnings are desired; `true` if
--- removal of deprecated apis is preferred
--- @int[opt=1] level debugging level
--- @bool[opt=true] strict `true` if strict enforcement of variable declaration
--- before use is desired
--- @usage
--- require 'std._debug'.argcheck = false
-
diff --git a/spec/init_spec.yaml b/spec/init_spec.yaml
deleted file mode 100644
index a10972c..0000000
--- a/spec/init_spec.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# Debug Hints Library for Lua 5.1, 5.2, 5.3 & 5.4
-# Copyright (C) 2014-2023 std.prototype authors
-
-before:
- this_module = 'std._debug'
-
- M = require(this_module)
- M.version = nil -- previous specs may have autoloaded it
-
-
-specify std._debug:
-- context when required:
- - it does not touch the global table:
- expect(show_apis {added_to='_G', by=this_module}).
- to_equal {}
-
-- context when lazy loading:
- - it has no submodules on initial load:
- for _, v in pairs(M) do
- expect(type(v)).not_to_be 'table'
- end
-
-
-- describe version:
- - before:
- x = M.version
-
- - it returns a string:
- expect(type(M.version)).to_be 'string'
- - it contains package description:
- expect(M.version).to_match '^Debug hints library '
diff --git a/spec/spec_helper.lua b/spec/spec_helper.lua
deleted file mode 100644
index 888ccd7..0000000
--- a/spec/spec_helper.lua
+++ /dev/null
@@ -1,229 +0,0 @@
---[[
- Debug Hints Library for Lua 5.1, 5.2, 5.3 & 5.4
- Copyright (C) 2014-2023 std._debug authors
-]]
-local typecheck
-have_typecheck, typecheck = pcall(require, 'typecheck')
-
-local inprocess = require 'specl.inprocess'
-local hell = require 'specl.shell'
-
-badargs = require 'specl.badargs'
-
-local cwd = os.getenv 'PWD'
-
-package.path = cwd .. '/lib/?.lua;' .. cwd .. '/lib/?/init.lua;' .. package.path
-
-
--- Allow user override of LUA binary used by hell.spawn, falling
--- back to environment PATH search for 'lua' if nothing else works.
-local LUA = os.getenv 'LUA' or 'lua'
-
-
--- Allow use of bare 'pack' and 'unpack' even in Lua 5.3.
-pack = table.pack or function(...) return {n = select('#', ...), ...} end
-unpack = table.unpack or unpack
-
-
-local function getmetamethod(x, n)
- local m =(getmetatable(x) or {})[tostring(n)]
- if type(m) == 'function' then
- return m
- end
- if type((getmetatable(m) or {}).__call) == 'function' then
- return m
- end
-end
-
-
-function copy(t)
- local r = {}
- for k, v in next, t do r[k] = v end
- return r
-end
-
-
--- In case we're not using a bleeding edge release of Specl...
-_diagnose = badargs.diagnose
-badargs.diagnose = function(...)
- if have_typecheck then
- return _diagnose(...)
- end
-end
-
-
--- A copy of base.lua:type, so that an unloadable base.lua doesn't
--- prevent everything else from working.
-function objtype(o)
- return(getmetatable(o) or {})._type or io.type(o) or type(o)
-end
-
-
-local function mkscript(code)
- local f = os.tmpname()
- local h = io.open(f, 'w')
- -- TODO: Move this into specl, or expose arguments so that we can
- -- turn this on and off based on specl `--coverage` arg.
- h:write "pcall(require, 'luacov')"
- h:write(code)
- h:close()
- return f
-end
-
-
---- Run some Lua code with the given arguments and input.
--- @string code valid Lua code
--- @tparam[opt={}] string|table arg single argument, or table of
--- arguments for the script invocation.
--- @string[opt] stdin standard input contents for the script process
--- @treturn specl.shell.Process|nil status of resulting process if
--- execution was successful, otherwise nil
-function luaproc(code, arg, stdin)
- local f = mkscript(code)
- if type(arg) ~= 'table' then arg = {arg} end
- local cmd = {LUA, f, unpack(arg)}
- -- inject env and stdin keys separately to avoid truncating `...` in
- -- cmd constructor
- cmd.env = { LUA_PATH=package.path, LUA_INIT='', LUA_INIT_5_2='' }
- cmd.stdin = stdin
- local proc = hell.spawn(cmd)
- os.remove(f)
- return proc
-end
-
-
-local function tabulate_output(code)
- local proc = luaproc(code)
- if proc.status ~= 0 then return error(proc.errout) end
- local r = {}
- proc.output:gsub('(%S*)[%s]*',
- function(x)
- if x ~= '' then r[x] = true end
- end)
- return r
-end
-
-
---- Show changes to tables wrought by a require statement.
--- There are a few modes to this function, controlled by what named
--- arguments are given. Lists new keys in T1 after `require "import"`:
---
--- show_apis {added_to=T1, by=import}
---
--- @tparam table argt one of the combinations above
--- @treturn table a list of keys according to criteria above
-function show_apis(argt)
- return tabulate_output([[
- local before, after = {}, {}
- for k in pairs(]] .. argt.added_to .. [[) do
- before[k] = true
- end
-
- local M = require ']] .. argt.by .. [['
- for k in pairs(]] .. argt.added_to .. [[) do
- after[k] = true
- end
-
- for k in pairs(after) do
- if not before[k] then print(k) end
- end
- ]])
-end
-
-
---[[ ================ ]]--
---[[ Tmpfile manager. ]]--
---[[ ================ ]]--
-
-
-local tmpdir = string.gsub(
- os.getenv 'TMPDIR' or os.getenv 'TMP' or '/tmp',
- '([^/])/*$', '%1'
-) .. '/normalize-' .. math.random(65536)
-
-
-local function append(path, ...)
- local n = select('#', ...)
- if n > 0 then
- local fh = io.open(path, 'a')
- fh:write(table.concat({...}, '\n') .. '\n')
- fh:close()
- end
- return n
-end
-
-
--- Create a temporary file.
--- @usage
--- h = Tmpfile() -- empty generated filename
--- h = Tmpfile(content) -- save *content* to generated filename
--- h = Tmpfile(name, line, line, line) -- write *line*s to *name*
-Tmpfile = setmetatable({}, {
- _type = 'Tmpfile',
-
- __call = function(self, path_or_content, ...)
- local new = {}
- if select('#', ...) == 0 then
- new.path = os.tmpname()
- append(new.path, path_or_content)
- else
- new.path = path_or_content
- append(new.path, ...)
- end
- return setmetatable(new, getmetatable(self))
- end,
-
- __index = {
- dirname = function(self)
- return self.path:gsub('/[^/]*$', '', 1)
- end,
-
- basename = function(self)
- return self.path:gsub('.*/', '')
- end,
-
- append = function(self, ...)
- return append(self.path, ...)
- end,
-
- remove = function(self)
- return os.remove(self.path)
- end,
- },
-})
-
-
-Tmpdir = setmetatable({}, {
- _type = 'Tmpdir',
-
- __call = function(self, dirname)
- local new = {
- path = dirname or tmpdir,
- children = {},
- }
- os.execute("mkdir '" .. new.path .. "'")
- return setmetatable(new, getmetatable(self))
- end,
-
- __index = {
- file = function(self, name, ...)
- local child = Tmpfile(self.path .. '/' .. name, ...)
- self.children[#self.children + 1] = child
- return child
- end,
-
- subdir = function(self, name)
- local child = Tmpdir(self.path .. '/' .. name)
- self.children[#self.children + 1] = child
- return child
- end,
-
- remove = function(self)
- for _, child in ipairs(self.children) do
- child:remove()
- end
- return os.remove(self.path)
- end,
- }
-})
-
diff --git a/spec/version_spec.yaml b/spec/version_spec.yaml
deleted file mode 100644
index 76056fb..0000000
--- a/spec/version_spec.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-# Debug Hints Library for Lua 5.1, 5.2, 5.3 & 5.4
-# Copyright (C) 2014-2023 std._debug authors
-
-before:
- this_module = 'std._debug.version'
-
- M = require(this_module)
-
-specify std._debug.version:
-- context when required:
- - it returns a string:
- expect(type(M)).to_be 'string'
- - it does not touch the global table:
- expect(show_apis {added_to='_G', by=this_module}).
- to_equal {}
-
-- describe version:
- - it describes this module:
- expect(M).to_match '^Debug hints library '
- - it ends with the release number:
- expect(M).to_match.any_of {' git$', ' %d[%.%d]*$'}
diff --git a/std._debug-git-1.rockspec b/std._debug-git-1.rockspec
deleted file mode 100644
index 1bb7bd7..0000000
--- a/std._debug-git-1.rockspec
+++ /dev/null
@@ -1,40 +0,0 @@
-local _MODREV, _SPECREV = 'git', '-1'
-
-package = 'std._debug'
-version = _MODREV .. _SPECREV
-
-description = {
- summary = 'Debug Hints Library',
- detailed = [[
- Manage an overall debug state, and associated hint substates.
- ]],
- homepage = 'http://lua-stdlib.github.io/_debug',
- license = 'MIT/X11',
-}
-
-source = {
- url = 'http://github.com/lua-stdlib/_debug/archive/v' .. _MODREV .. '.zip',
- dir = '_debug-' .. _MODREV,
-}
-
-dependencies = {
- 'lua >= 5.1, < 5.5',
-}
-
-
-build = {
- type = 'builtin',
- modules = {
- ['std._debug'] = 'lib/std/_debug/init.lua',
- ['std._debug.version'] = 'lib/std/_debug/version.lua',
- },
- copy_directories = {'doc'},
-}
-
-if _MODREV == 'git' then
- build.copy_directories = nil
-
- source = {
- url = 'git://github.com/lua-stdlib/_debug.git',
- }
-end