dotfiles from arch

This commit is contained in:
2025-09-28 11:39:12 +02:00
parent 75885729cd
commit d1c6923bbb
1358 changed files with 575835 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
---@meta _
---#DES 'arg'
---@type string[]
arg = {}
---#DES 'assert'
---@generic T
---@param v? T
---@param message? any
---@param ... any
---@return T
---@return any ... => args[reti + 1]
---@throw => args[1].isFalsy
---@narrow v => args[1].truly
function assert(v, message, ...) end
--[[@@@
---@overload fun(opt: 'collect') # ---#DESTAIL 'cgopt.collect'
---@overload fun(opt: 'stop') # ---#DESTAIL 'cgopt.stop'
---@overload fun(opt: 'restart') # ---#DESTAIL 'cgopt.restart'
---@overload fun(opt: 'count'): integer # ---#DESTAIL 'cgopt.count'
---@overload fun(opt: 'step'): boolean # ---#DESTAIL 'cgopt.step'
---@overload fun(opt: 'isrunning'): boolean # ---#DESTAIL 'cgopt.isrunning'
---#if VERSION >= 5.4 then
---@overload fun(opt: 'incremental'
, pause?: integer
, stepmul?: integer
, stepsize?: integer) # ---#DESTAIL 'cgopt.incremental'
---@overload fun(opt: 'generational'
, minor?: integer
, major?: integer) # ---#DESTAIL 'cgopt.generational'
---#end
---@overload fun(opt: 'setpause', arg: integer) # ---#DESTAIL 'cgopt.setpause'
---@overload fun(opt: 'setstepmul', arg: integer) # ---#DESTAIL 'cgopt.setstepmul'
---@prototype
]]
function collectgarbage(...) end
---#DES 'dofile'
---@param filename? string
---@return any
---@custom dofile
function dofile(filename) end
---#DES 'error'
---@param message any
---@param level? integer
---@throw
function error(message, level) end

View File

@@ -0,0 +1,18 @@
---@meta _
---@class nil
---@class never
---@class true
---@class false
---@class any: { [unknown]: any }
---@class truly: { [unknown]: any }
---@class unknown: truly | false
---@class boolean
---@class number
---@class thread
---@class table: { [unknown]: any }
---@class table<K, V>: { [K]: V }
---@class string: stringlib
---@class userdata: { [unknown]: any }
---@class lightuserdata
---@class function: fun(...): ...

View File

@@ -0,0 +1,128 @@
local cat
cat.rule.default = function (self)
self.isTruly = true
self.truly = self
self.falsy = cat.class 'never'
self.view = self.name
end
cat.rule.never = function (self)
self.isTruly = nil
end
cat.rule.any = function (self)
self.isTruly = nil
self.truly = cat.class 'truly'
self.falsy = cat.boolean(false) | cat.class 'nil'
end
cat.rule['nil'] = function (self)
self.isTruly = false
self.truly = cat.class 'never'
self.falsy = self
end
cat.rule.boolean = function (self)
if self.value == true then
self.isTruly = true
self.truly = self
self.falsy = cat.class 'never'
elseif self.value == false then
self.isTruly = false
self.truly = cat.class 'never'
self.falsy = self
else
self.isTruly = nil
self.truly = cat.boolean(true)
self.falsy = cat.boolean(false)
end
end
cat.rule.number = function (self)
self.isTruly = true
self.truly = self
self.falsy = cat.class 'never'
self.view = tostring(self.value)
end
cat.rule.integer = function (self)
self.isTruly = true
self.truly = self
self.falsy = cat.class 'never'
self.view = tostring(self.value)
end
cat.rule.string = function (self)
self.isTruly = true
self.truly = self
self.falsy = cat.class 'never'
self.view = cat.util.viewString(self.value, self.quotation)
end
cat.rule.union = function (self)
self.isTruly = function (union)
local isTruly = union.subs[1].isTruly
if isTruly == nil then
return nil
end
if isTruly == true then
for i = 2, #union.subs do
if union.subs[i].isTruly ~= true then
return nil
end
end
return true
else
for i = 2, #union.subs do
if union.subs[i].isTruly ~= false then
return nil
end
end
return false
end
return nil
end
self.truly = function (union)
local new = cat.union()
for i = 1, #union.subs do
new:add(union.subs[i].truly)
end
if new:len() == 0 then
return cat.class 'never'
end
if new:len() == 1 then
return new[1]
end
return new
end
self.falsy = function (union)
local new = cat.union()
for i = 1, #union.subs do
new:add(union.subs[i].falsy)
end
if new:len() == 0 then
return cat.class 'never'
end
if new:len() == 1 then
return new[1]
end
return new
end
self.view = function (union)
local views = {}
for i = 1, #union.subs do
views[i] = union.subs[i].view
end
if #views == 0 then
return 'never'
end
return table.concat(views, '|')
end
end
cat.custom.dofile.onReturn = function (context)
local filename = context.args[1].asString
local file = cat.files[filename]
return file.returns[1]
end