repo
stringclasses
341 values
file_path
stringlengths
29
173
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.66M
tokens
int64
2
598k
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Map/Map.lua
luau
.lua
--!strict local __DEV__ = _G.__DEV__ local Collections = script.Parent.Parent local Packages = Collections.Parent local arrayForEach = require(Collections.Array.forEach) local arrayMap = require(Collections.Array.map) local isArray = require(Collections.Array.isArray) local instanceof = require(Packages.InstanceOf) lo...
1,438
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Map/coerceToMap.lua
luau
.lua
local MapModule = script.Parent local Collections = MapModule.Parent local Packages = Collections.Parent local Map = require(MapModule.Map) local Object = require(Collections.Object) local instanceOf = require(Packages.InstanceOf) local types = require(Packages.ES7Types) type Map<K, V> = types.Map<K, V> type Table<K,...
160
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Map/coerceToTable.lua
luau
.lua
local MapModule = script.Parent local Collections = MapModule.Parent local Packages = Collections.Parent local Map = require(MapModule.Map) local instanceOf = require(Packages.InstanceOf) local arrayReduce = require(Collections.Array.reduce) local types = require(Packages.ES7Types) type Map<K, V> = types.Map<K, V> ty...
178
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Map/init.lua
luau
.lua
local Packages = script.Parent.Parent local ES7Types = require(Packages.ES7Types) local Map = require(script.Map) local coerceToMap = require(script.coerceToMap) local coerceToTable = require(script.coerceToTable) export type Map<K, V> = ES7Types.Map<K, V> return { Map = Map, coerceToMap = coerceToMap, coerceToT...
94
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/assign.lua
luau
.lua
--!strict local Object = script.Parent local Packages = Object.Parent.Parent local None = require(Object.None) local types = require(Packages.ES7Types) type Object = types.Object --[[ Merges values from zero or more tables onto a target table. If a value is set to None, it will instead be removed from the table. ...
528
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/freeze.lua
luau
.lua
--!strict local Object = script.Parent local Packages = Object.Parent.Parent local types = require(Packages.ES7Types) type Array<T> = types.Array<T> type Object = types.Object return function<T>(t: T & (Object | Array<any>)): T -- Luau FIXME: model freeze better so it passes through the type constraint and doesn't e...
97
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/init.lua
luau
.lua
--!strict return { assign = require(script.assign), entries = require(script.entries), freeze = require(script.freeze), is = require(script.is), isFrozen = require(script.isFrozen), keys = require(script.keys), preventExtensions = require(script.preventExtensions), seal = require(script.seal), values = requir...
107
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/isFrozen.lua
luau
.lua
--!strict local __DEV__ = _G.__DEV__ local Object = script.Parent local Packages = Object.Parent.Parent local types = require(Packages.ES7Types) type Array<T> = types.Array<T> type Object = types.Object return function(t: Object | Array<any>): boolean if __DEV__ then print("Luau now has a direct table.isfrozen cal...
106
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/keys.lua
luau
.lua
local Object = script.Parent local Collections = Object.Parent local Packages = Object.Parent.Parent local Set = require(Collections.Set) local types = require(Packages.ES7Types) local instanceOf = require(Packages.InstanceOf) type Array<T> = types.Array<T> type Set<T> = types.Set<T> type Table = { [any]: any } retur...
221
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/preventExtensions.lua
luau
.lua
--!strict local Object = script.Parent local Packages = Object.Parent.Parent local types = require(Packages.ES7Types) type Array<T> = types.Array<T> type Object = types.Object -- FIXME: This should be updated to be closer to the actual -- `Object.preventExtensions` functionality in JS. This requires additional -- sup...
187
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Object/values.lua
luau
.lua
--!strict local Object = script.Parent local Packages = Object.Parent.Parent local types = require(Packages.ES7Types) type Array<T> = types.Array<T> -- TODO Luau: needs overloads to model this more correctly return function<T>(value: { [string]: T } | Array<T> | string): Array<T> | Array<string> if value == nil then...
240
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/Set/init.lua
luau
.lua
--!nonstrict local __DEV__ = _G.__DEV__ local Collections = script.Parent local Packages = Collections.Parent local inspect = require(Collections.inspect) local isArray = require(Collections.Array.isArray) local arrayForEach = require(Collections.Array.forEach) local arrayFromString = require(Collections.Array.from.fr...
1,067
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/WeakMap.lua
luau
.lua
--!strict local Collections = script.Parent local Packages = Collections.Parent local ES7Types = require(Packages.ES7Types) type WeakMap<K, V> = ES7Types.WeakMap<K, V> type WeakMapPrivate<K, V> = { _weakMap: { [K]: V }, -- method definitions get: (self: WeakMapPrivate<K, V>, K) -> V, set: (self: WeakMapPrivate<K...
305
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/collections/src/init.lua
luau
.lua
--!strict local Packages = script.Parent local Array = require(script.Array) local Map = require(script.Map) local Object = require(script.Object) local Set = require(script.Set) local WeakMap = require(script.WeakMap) local inspect = require(script.inspect) local types = require(Packages.ES7Types) export type Array...
180
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/console/src/init.lua
luau
.lua
--!strict local makeConsoleImpl = require(script.makeConsoleImpl) return makeConsoleImpl()
20
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/console/src/makeConsoleImpl.lua
luau
.lua
--!strict local root = script.Parent local Packages = root.Parent local inspect = require(Packages.Collections).inspect local INDENT = " " return function() local console = {} local indentDepth = 0 local function indent() return string.rep(INDENT, indentDepth) end function console.log(content, ...) local ...
525
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/es7-types/src/init.lua
luau
.lua
--!strict export type Object = { [string]: any } export type Array<T> = { [number]: T } export type Function = (...any) -> ...any export type Table<T, V> = { [T]: V } export type Tuple<T, V> = Array<T | V> export type mapCallbackFn<K, V> = (element: V, key: K, map: Map<K, V>) -> () export type mapCallbackFnWithThisArg<...
831
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/instance-of/src/init.lua
luau
.lua
local instanceof = require(script.instanceof) return instanceof
11
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/instance-of/src/instanceof.lua
luau
.lua
--!strict -- polyfill for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof local __DEV__ = _G.__DEV__ -- FIXME Luau: typing class as Object gives: Type '{ @metatable {| __call: <a>(a, ...any) -> Error, __tostring: <b, c>({+ message: b, name: c +}) -> string |}, Error }' could not ...
326
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/luau-polyfill/src/AssertionError/init.lua
luau
.lua
local AssertionErrorModule = require(script["AssertionError.global"]) export type AssertionError = AssertionErrorModule.AssertionError return AssertionErrorModule.AssertionError
28
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/luau-polyfill/src/Error/init.lua
luau
.lua
local Error = require(script["Error.global"]) export type Error = Error.Error return Error
19
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/luau-polyfill/src/Promise.lua
luau
.lua
-- this maps onto community promise libraries which won't support Luau, so we inline export type PromiseLike<T> = { andThen: ( self: PromiseLike<T>, resolve: ((T) -> ...(nil | T | PromiseLike<T>))?, reject: ((any) -> ...(nil | T | PromiseLike<T>))? ) -> PromiseLike<T>, } type PromiseStatus = "Started" | "Resol...
313
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/luau-polyfill/src/encodeURIComponent.lua
luau
.lua
-- reference documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent local HttpService = game:GetService("HttpService") local root = script.Parent local Packages = root.Parent local String = require(Packages.String) local charCodeAt = String.charCodeAt local ...
352
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/luau-polyfill/src/init.lua
luau
.lua
--!strict local Packages = script.Parent local Boolean = require(Packages.Boolean) local Collections = require(Packages.Collections) local Console = require(Packages.Console) local Math = require(Packages.Math) local Number = require(Packages.Number) local String = require(Packages.String) local Symbol = require(Packa...
394
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/math/src/init.lua
luau
.lua
--!strict return { clz32 = require(script.clz32), }
17
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/MAX_SAFE_INTEGER.lua
luau
.lua
--!strict -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER return 9007199254740991
38
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/MIN_SAFE_INTEGER.lua
luau
.lua
--!strict -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER return -9007199254740991
38
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/init.lua
luau
.lua
--!strict return { isFinite = require(script.isFinite), isInteger = require(script.isInteger), isNaN = require(script.isNaN), isSafeInteger = require(script.isSafeInteger), MAX_SAFE_INTEGER = require(script.MAX_SAFE_INTEGER), MIN_SAFE_INTEGER = require(script.MIN_SAFE_INTEGER), NaN = 0 / 0, toExponential = requ...
82
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/isFinite.lua
luau
.lua
--!strict return function(value) return typeof(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge end
36
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/isInteger.lua
luau
.lua
--!strict -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger return function(value) return type(value) == "number" and value ~= math.huge and value == math.floor(value) end
54
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/isNaN.lua
luau
.lua
--!strict -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN return function(value) return type(value) == "number" and value ~= value end
46
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/isSafeInteger.lua
luau
.lua
--!strict -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger local isInteger = require(script.Parent.isInteger) local MAX_SAFE_INTEGER = require(script.Parent.MAX_SAFE_INTEGER) return function(value) return isInteger(value) and math.abs(value) <= MAX_SAFE_INTEGER ...
71
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/number/src/toExponential.lua
luau
.lua
--!strict -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential return function(value: string | number, fractionDigits: number?): string | nil local num = value if typeof(value) == "string" then -- ROBLOX FIXME: add parseInt to encapsulate this logic and use it her...
298
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/charCodeAt.lua
luau
.lua
--!strict local String = script.Parent local Packages = String.Parent local Number = require(Packages.Number) local NaN = Number.NaN -- js https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt -- lua http://www.lua.org/manual/5.4/manual.html#pdf-utf8.codepoint return func...
267
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/endsWith.lua
luau
.lua
--!strict local function endsWith(value: string, substring: string, optionalLength: number?): boolean local substringLength = substring:len() if substringLength == 0 then return true end local valueLength = value:len() local length = optionalLength or valueLength if length > valueLength then length = valueLen...
119
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/findOr.lua
luau
.lua
--!strict type Match = { index: number, match: string, } -- excluding the `+` and `*` character, since findOr tests and graphql use them explicitly local luaPatternCharacters = "([" .. ("$%^()-[].?"):gsub("(.)", "%%%1") .. "])" local function findOr(str: string, patternTable: { string }, initIndex: number?): Match ...
423
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/includes.lua
luau
.lua
--!strict -- excluding the `+` and `*` character, since findOr tests and graphql use them explicitly local luaPatternCharacters = "([" .. ("$%^()-[].?"):gsub("(.)", "%%%1") .. "])" local function includes(str: string, substring: string, position: (string | number)?): boolean local strLen, invalidBytePosition = utf8....
249
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/indexOf.lua
luau
.lua
--!strict -- excluding the `+` and `*` character, since findOr tests and graphql use them explicitly local luaPatternCharacters = "([" .. ("$%^()-[].?"):gsub("(.)", "%%%1") .. "])" -- Implements equivalent functionality to JavaScript's `String.indexOf`, -- implementing the interface and behaviors defined at: -- https...
258
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/init.lua
luau
.lua
return { charCodeAt = require(script.charCodeAt), endsWith = require(script.endsWith), findOr = require(script.findOr), includes = require(script.includes), indexOf = require(script.indexOf), lastIndexOf = require(script.lastIndexOf), slice = require(script.slice), split = require(script.split), startsWith = r...
127
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/lastIndexOf.lua
luau
.lua
--!strict local function lastIndexOf(str: string, searchValue: string, fromIndex: number?): number local strLength = string.len(str) local calculatedFromIndex if fromIndex then calculatedFromIndex = fromIndex else calculatedFromIndex = strLength end if fromIndex and fromIndex < 1 then calculatedFromIndex = ...
317
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/slice.lua
luau
.lua
--!strict local function slice(str: string, startIndexStr: string | number, lastIndexStr: (string | number)?): string local strLen, invalidBytePosition = utf8.len(str) assert(strLen ~= nil, ("string `%s` has an invalid byte at position %s"):format(str, tostring(invalidBytePosition))) local startIndex = tonumber(star...
322
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/split.lua
luau
.lua
--!strict local String = script.Parent local findOr = require(String.findOr) local slice = require(String.slice) local Packages = String.Parent local types = require(Packages.ES7Types) type Array<T> = types.Array<T> local MAX_SAFE_INTEGER = require(Packages.Number).MAX_SAFE_INTEGER type Pattern = string | Array<strin...
527
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/startsWith.lua
luau
.lua
--!strict local function startsWith(value: string, substring: string, position: number?): boolean if string.len(substring) == 0 then return true end -- Luau FIXME: we have to use a tmp variable, as Luau doesn't understand the logic below narrow position to `number` local position_ if position == nil or position ...
135
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/substr.lua
luau
.lua
--!strict return function(s: string, startIndex: number, numberOfCharacters: number?): string if numberOfCharacters and numberOfCharacters <= 0 then return "" end return string.sub(s, startIndex, numberOfCharacters and startIndex + numberOfCharacters - 1 or nil) end
59
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/trim.lua
luau
.lua
--!strict local trimStart = require(script.Parent.trimStart) local trimEnd = require(script.Parent.trimEnd) return function(source: string): string return trimStart(trimEnd(source)) end
41
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/trimEnd.lua
luau
.lua
--!strict return function(source: string): string return (source:gsub("[%s]+$", "")) end
24
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/string/src/trimStart.lua
luau
.lua
--!strict return function(source: string): string return (source:gsub("^[%s]+", "")) end
25
Roblox/luau-polyfill
Roblox-luau-polyfill-68fef52/modules/timers/src/init.lua
luau
.lua
--!strict local Packages = script.Parent local Object = require(Packages.Collections).Object local makeTimerImpl = require(script.makeTimerImpl) local makeIntervalImpl = require(script.makeIntervalImpl) export type Timeout = makeTimerImpl.Timeout export type Interval = makeIntervalImpl.Interval return Object.assign...
76
Bottersnike/eryx
Bottersnike-eryx-253f0ae/eryxdoc.config.luau
luau
.luau
return { output = "build-docs/", title = "Eryx", siteRoot = "/", baseUrl = "https://eryx.bsnk.me", exportMode = "directory", static = "./docs/static", staticMount = "/", head = { { tag = "link", rel = "icon", type = "image/png", href = "/favicon-96x96.png", sizes = "96x96" }, { tag = "link", rel = "icon",...
683
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/scripts/doc.luau
luau
.luau
--[[ Documentation generator CLI with optional live-reload dev server. Usage: eryx eryxdoc/main.luau [options] -- build + watch + serve eryx eryxdoc/main.luau --no-serve -- build + watch only eryx eryxdoc/main.luau --no-watch --no-serve -- one-shot build Run with --help for full opt...
4,321
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/assets.luau
luau
.luau
local fs = require("@eryx/fs") local pathlib = require("@eryx/path") local assets = {} local function normalizeWebPath(path: string): string return (path:gsub("\\", "/")) end local function splitUrl(url: string): (string, string) local pathPart, suffix = url:match("^([^?#]*)(.*)$") return pathPart or url, suffix ...
779
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/content/article.luau
luau
.luau
local fs = require("@eryx/fs") local markdown = require("@markdown") local yaml = require("@eryx/data/yaml") export type ArticleMeta = { [string]: any } export type SidebarModule = { name: string, displayName: string, filename: string, children: { SidebarModule }, } export type SidebarArticle = { title: string,...
926
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/export.luau
luau
.luau
local json = require("@eryx/data/json") local modulesApi = require("@self/content/modules") local buildWarnings = require("@self/warnings") type ModuleInfo = modulesApi.ModuleInfo export type ModuleJsonOptions = { pretty: boolean?, } local funcDocs local function array<T>(values: { T }?): { T } if values and next...
1,724
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/extract/classDetection.luau
luau
.luau
--- @ignore -- Detects class patterns in type aliases (setmetatable-based class idioms). local luau = require("@eryx/luau/ast") local function unwrapTypeOrPack(value: any): luau.AstType? if type(value) ~= "table" then return nil end if value.type then return value :: luau.AstType end if value.kind == "Type"...
974
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/extract/members.luau
luau
.luau
--- @ignore -- Builds FuncDoc records from type table properties (class members and properties). local luau = require("@eryx/luau/ast") local doctags = require("../parse/doctags") local types = require("./types") local td = require("./typeDescriber") local signatures = require("./signatures") type ParsedDoc = doctag...
1,957
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/extract/signatures.luau
luau
.luau
--- @ignore -- Function signature extraction and rendering in multiple formats: -- compact one-liner, multi-line with doc comments, structured token array, and metadata. local luau = require("@eryx/luau/ast") local doctags = require("../parse/doctags") local types = require("./types") local td = require("./typeDescri...
5,761
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/extract/typeDescriber.luau
luau
.luau
--- @ignore -- Converts AST type nodes into human-readable string and structured token representations. -- -- `describeTypeParts` is the single source of truth for rendering types. -- `describeType` derives the string by concatenating part texts. local luau = require("@eryx/luau/ast") local types = require("./types")...
4,899
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/extract/types.luau
luau
.luau
-- Shared type definitions for the documentation extraction pipeline. local luau = require("@eryx/luau/ast") local doctags = require("../parse/doctags") type ParsedDoc = doctags.ParsedDoc export type SignaturePart = { text: string, typeRef: boolean?, hoverText: string?, kind: ("type" | "param" | "punct" | "keywo...
799
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/parse/doctags.luau
luau
.luau
-- Parses doc-comment tags from raw comment text. -- -- Supported tags: -- @yields Marks function as yieldable (no arguments) -- @param <name> [description] Parameter documentation (name must match a known param) -- @param <name> <type> -- [desc] Parameter with explicit type override ...
2,642
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/parse/highlight.luau
luau
.luau
local regex = require("@eryx/regex") local function htmlEscape(s: string): string if not s then return "" end return (s:gsub("&", "&amp;"):gsub("<", "&lt;"):gsub(">", "&gt;"):gsub('"', "&quot;")) end type RegexRule = { class: string?, regex: regex.Regex, } local function span(className: string?, text: string)...
6,038
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/render/links.luau
luau
.luau
-- Link and anchor resolution for documentation cross-references. -- Pure functions that resolve wiki-style links and type references to URLs. local modules = require("../content/modules") local warnings = require("../warnings") export type ResolvedWikiLink = { href: string, kind: "article" | "module" | "class" | "...
3,659
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/siteModel.luau
luau
.luau
local fs = require("@eryx/fs") local logging = require("@eryx/logging") local yaml = require("@eryx/data/yaml") local modulesApi = require("@self/content/modules") local Article = require("@self/content/article") local buildWarnings = require("@self/warnings") local log = logging.getLogger("eryxdoc.siteModel") expor...
3,435
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/eryxdoc/src/warnings.luau
luau
.luau
--- @ignore -- Simple build warnings collector. -- Modules call warn() during the build; main.luau calls summary() at the end. local logging = require("@eryx/logging") local log = logging.getLogger("eryxdoc.warnings") local warnings: { string } = {} local function warn(msg: string) table.insert(warnings, msg) lo...
119
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/entities.luau
luau
.luau
--- @ignore -- HTML5 named character references (auto-generated from WHATWG spec) -- Maps entity name (without & and ;) to a list of Unicode codepoints local ENTITIES = { ["AElig"] = { 0x00C6 }, ["AMP"] = { 0x0026 }, ["Aacute"] = { 0x00C1 }, ["Abreve"] = { 0x0102 }, ["Acirc"] = { 0x00C2 }, ["Acy"] = { 0x0410 }, ...
29,922
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/extensions/colour.luau
luau
.luau
local types = require("../types") local function parse_alpha(x: string): boolean local n = tonumber(x) if not n then return false end return n >= 0 and n <= 1 end local function isRGB(s: string): boolean -- normalize commas -> spaces local body = s:match("^rgba?%((.*)%)$") if not body then return false en...
928
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/extensions/footnoteInline.luau
luau
.luau
local html = require("../htmlRenderer") local types = require("../types") local FootnoteInlineRule: types.InlineRule = { name = "footnote_ref", matchOpen = "[^", tryParse = function(ctx, pos) -- Try to parse [^label] as a footnote reference local fnEnd: number? = nil local p = pos + 2 while p <= ctx.len do ...
384
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/extensions/strikethrough.luau
luau
.luau
local types = require("../types") local html = require("../htmlRenderer") --- GFM tilde delimiter resolver local strikethrough: types.InlineEmphasisRule = { character = "~", name = "strikethrough", resolve = function(opener, closer) -- GFM-style strikethrough: only allow 1 or 2 tildes, never use 3+ as a single de...
192
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/extensions/wikilink.luau
luau
.luau
local html = require("../htmlRenderer") local types = require("../types") local function trim(s: string): string return (s:gsub("^[\t\r\n ]*(.-)[\t\r\n ]*$", "%1")) end return function(linkResolver): types.InlineRule return { name = "wikilink", matchOpen = "[[", tryParse = function(ctx, p) if p + 1 > ctx.l...
792
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/html.luau
luau
.luau
--- @ignore local rules = require("./rules") local types = require("./types") local render = require("./htmlRenderer") local html = {} function html.renderDocument(doc: types.DocumentBlockNode, config: types.MarkdownConfig): string local renderConfig = table.clone(config) local renderConfigAny = renderConfig :: an...
271
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/htmlRenderer.luau
luau
.luau
--- @ignore local types = require("./types") local util = require("./util") local html = {} --- Escape text for safe inclusion in HTML content or attribute values. --- Handles the four characters that are meaningful in both contexts. function html.renderLiteral(text: string): string local buf = {} for i = 1, #text...
2,552
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/init.luau
luau
.luau
local block = require("@self/parseBlock") local inline = require("@self/parseInline") local types = require("@self/types") local html = require("@self/html") local rules = require("@self/rules") local util = require("@self/util") -- Built-in inline extensions local AutolinkRule = require("@self/rules/autolink") local ...
1,046
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/rules/autolink.luau
luau
.luau
local types = require("../types") local util = require("../util") local html = require("../htmlRenderer") --- Autolink and inline-HTML inline handler builder local autolink: types.InlineRule = { name = "autolink", matchOpen = "<", tryParse = function(ctx, pos) -- attempt autolink like in main parser local scanP...
977
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/rules/blockQuote.luau
luau
.luau
local html = require("../htmlRenderer") local tabUtil = require("../tabUtil") local types = require("../types") -- Block quote: continues with ">", starts with ">" local BlockQuoteRule: types.BlockRule<"block_quote", { children: { types.AnyBlockNode } }> = { name = "block_quote", continueBlock = function(_block, lin...
759
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/rules/setextHeading.luau
luau
.luau
local html = require("../htmlRenderer") local tabUtil = require("../tabUtil") local types = require("../types") local util = require("../util") --- Check if the line from `offset` is a setext heading underline. --- Returns 1 for `=`, 2 for `-`, or nil if not a valid underline. local function isSetextUnderline(line: st...
1,080
Bottersnike/eryx
Bottersnike-eryx-253f0ae/packages/markdown/src/rules/thematicBreak.luau
luau
.luau
local tabUtil = require("../tabUtil") local types = require("../types") -- Thematic break: single-line leaf, never continues local ThematicBreakRule: types.BlockRule<"thematic_break", {}> = { name = "thematic_break", continueBlock = function(_block, _line: string, cursor: tabUtil.LineCursor): types.ContinueResult ...
551
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/_embedded.luau
luau
.luau
--[=[ Access to read-only Luau sources baked into embedded or hybrid builds. ]=] local embedded = {} --- Reads an embedded source entry by its module-table key. --- Accepts bare keys like `eryxdoc/theme/style.css` and `@eryx/...` paths. --- Returns nil when no embedded table is registered or the key is absent. funct...
122
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/_fs_watch.luau
luau
.luau
local _fs_watch = {} local path = require("@eryx/path") type PathLike = path.PathLike export type WatchEventKind = "create" | "remove" | "modify" | "rename" | "overflow" | "unknown" export type WatchEvent = { kind: WatchEventKind, path: string, oldPath: string?, filename: string?, oldFilename: string?, relativ...
297
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/_native/_path.luau
luau
.luau
local native = {} --[=[ Resolves a path to an absolute canonical form via the filesystem. This is a low-level native helper consumed by `@eryx/path`. @param input Path string or path-like object to canonicalize. @return string -- Canonical absolute path string. ]=] function native.canonicalize(input: any): strin...
83
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/_native/stub.luau
luau
.luau
return nil :: any
5
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/_socket.luau
luau
.luau
--[=[ Low-level BSD socket API for Luau. This library exposes the platform's native socket interface, providing TCP and UDP networking with non-blocking I/O support. All data transfer uses Luau `buffer` objects for zero-copy efficiency. :::caution This is a **low-level** API. For HTTP, prefer using `@eryx/http`...
3,396
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/_ssl.luau
luau
.luau
--[=[ TLS/SSL support for Luau, powered by OpenSSL. Provides encrypted communication over sockets using TLS 1.2+. Includes both client and server context creation, certificate generation, and certificate parsing utilities. :::note Optional capability This library is a typed facade over an optional native backen...
2,583
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/archive/tar.test.luau
luau
.luau
local test = require("@eryx/test") local tar = require("@eryx/archive/tar") local suite = test.Suite.new("tar") type StubSeekableStream = { readable: true, closed: boolean, read: (self: StubSeekableStream, size: number?) -> string, readSync: (self: StubSeekableStream, size: number?) -> string, readBuffer: (self:...
729
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/archive/zip.luau
luau
.luau
--[=[ Zip file entry metadata returned by `zip.list` and `ZipReader:list`. @field name string: the entry filename (directories end with '/') @field size number: uncompressed size in bytes @field compressedSize number: compressed size in bytes @field method number: compression method (compare with `zip.METHOD_*`) ...
943
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/archive/zip.test.luau
luau
.luau
local test = require("@eryx/test") local zip = require("@eryx/archive/zip") local suite = test.Suite.new("zip") local HELLO = buffer.fromstring("hello") suite:test("isZip: accepts valid archive", function() local archive = zip.pack({ ["hello.txt"] = HELLO }) test.expect(zip.isZip(archive)):toBeTrue() end) suite:t...
588
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/argparse.test.luau
luau
.luau
local argparse = require("@eryx/argparse") local test = require("@eryx/test") local suite = test.Suite.new("argparse") suite:test("parse: supports flags options and positionals", function() local parser = argparse.Parser.new("tool", "desc") parser:addPositional("file", "string", nil, true, "Input file") parser:add...
1,542
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/bufferBuilder.luau
luau
.luau
--!native local BufferBuilder = {} BufferBuilder.__index = BufferBuilder export type BufferBuilder = setmetatable<{ buf: buffer, offset: number, }, typeof(BufferBuilder)> function BufferBuilder.new(initial: number?): BufferBuilder local self = { buf = buffer.create(initial or 512), offset = 0, } return set...
1,088
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/caching.luau
luau
.luau
--[=[ Small in-memory cache primitives. - bounded key/value caches - TTL-based expiration - memoization built on top of those caches Higher-level policy such as HTTP cache semantics should live in the consumer modules rather than here. ]=] local NIL_VALUE = newproxy(false) local NIL_KEY = newproxy(false) local...
2,594
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/caching.test.luau
luau
.luau
local cache = require("@eryx/caching") local test = require("@eryx/test") local suite = test.Suite.new("cache") suite:test("lru stores false and nil values without ambiguity", function() local c = cache.lru<<string, boolean?>>({ maxEntries = 4 }) c:set("false", false) c:set("nil", nil) local falseValue, falseFo...
1,021
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/capability.luau
luau
.luau
local capability = {} local cache: { [string]: { ok: boolean, value: any } } = {} function capability.optional(moduleName: string): (any?, any?) local cached = cache[moduleName] if cached ~= nil then if cached.ok then return cached.value, nil end return nil, cached.value end local ok, value = pcall(requ...
238
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/brotli.luau
luau
.luau
--[=[ Brotli compression helpers. ]=] local brotli = {} --[=[ Compress data with Brotli. @param data buffer -- input bytes to compress @param quality number? -- 0..11 (QUALITY_MIN..QUALITY_MAX). Default 11. @param lgwin number? -- log2 window size in bytes (WINDOW_MIN..WINDOW_MAX). Default 22. @param mode number...
707
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/brotli.test.luau
luau
.luau
local test = require("@eryx/test") local brotli = require("@eryx/compression/brotli") local suite = test.Suite.new("brotli") local HELLO = buffer.fromstring("hello") local PANGRAM = buffer.fromstring("The quick brown fox jumps over the lazy dog") local REPEAT = buffer.fromstring(string.rep("abcdefgh", 100)) -- repeti...
354
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/bzip2.luau
luau
.luau
--[=[ Bzip2 compression utilities. ]=] local bzip2 = {} --[=[ Compress data with bzip2. @param data buffer -- input bytes to compress @param blockSize number? -- block size 1..9 (higher=better compression) @return buffer -- compressed bzip2 stream blockSize: 1 (BLOCK_FAST, least memory) - 9 (BLOCK_BEST, best co...
616
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/bzip2.test.luau
luau
.luau
local test = require("@eryx/test") local bzip2 = require("@eryx/compression/bzip2") local suite = test.Suite.new("bzip2") local HELLO = buffer.fromstring("hello") local PANGRAM = buffer.fromstring("The quick brown fox jumps over the lazy dog") local REPEAT = buffer.fromstring(string.rep("abcdefgh", 100)) -- repetitiv...
393
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/gzip.luau
luau
.luau
--[=[ Gzip helpers: compress/decompress and header inspection utilities. ]=] export type GzipHeader = { method: number, --- compression method (8 = deflate) flags: number, --- raw FLG byte mtime: number, --- modification time (Unix timestamp, 0 if not set) xfl: number, --- extra flags os: number, --- OS identifie...
942
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/gzip.test.luau
luau
.luau
local test = require("@eryx/test") local gzip = require("@eryx/compression/gzip") local suite = test.Suite.new("gzip") local HELLO = buffer.fromstring("hello") local PANGRAM = buffer.fromstring("The quick brown fox jumps over the lazy dog") local REPEAT = buffer.fromstring(string.rep("abcdefgh", 100)) -- repetitive d...
518
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/stream.luau
luau
.luau
local streamTypes = require("@eryx/stream") local compressionStream = {} local DecompressionReadStream = {} DecompressionReadStream.__index = DecompressionReadStream local CompressionWriteStream = {} CompressionWriteStream.__index = CompressionWriteStream export type Decompressor = { write: (self: any, data: buffer...
1,839
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/zlib.luau
luau
.luau
--[=[ Zlib utilities: compress/decompress, checksums, and helpers. ]=] local zlib = {} --[=[ Standard zlib compress (zlib header + Adler-32 trailer). @param data buffer -- input bytes to compress @param level number? -- compression level (NO_COMPRESSION..BEST_COMPRESSION) @return buffer -- compressed zlib stream ...
1,430
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/zlib.test.luau
luau
.luau
local test = require("@eryx/test") local zlib = require("@eryx/compression/zlib") local suite = test.Suite.new("zlib") local HELLO = buffer.fromstring("hello") local PANGRAM = buffer.fromstring("The quick brown fox jumps over the lazy dog") local REPEAT = buffer.fromstring(string.rep("abcdefgh", 100)) -- repetitive d...
489
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/zstd.luau
luau
.luau
--[=[ Zstandard compression helpers: compress/decompress and dictionary support. ]=] local zstd = {} --[=[ Compress data with Zstandard. @param data buffer -- input bytes to compress @param level number? -- compression level (CLEVEL_MIN..CLEVEL_MAX) @return buffer -- compressed zstd frame level: CLEVEL_MIN (neg...
883
Bottersnike/eryx
Bottersnike-eryx-253f0ae/src/modules/compression/zstd.test.luau
luau
.luau
local test = require("@eryx/test") local zstd = require("@eryx/compression/zstd") local suite = test.Suite.new("zstd") local HELLO = buffer.fromstring("hello") local PANGRAM = buffer.fromstring("The quick brown fox jumps over the lazy dog") local REPEAT = buffer.fromstring(string.rep("abcdefgh", 100)) -- repetitive d...
524