repo
stringclasses
350 values
file_path
stringlengths
29
200
language
stringclasses
2 values
file_type
stringclasses
4 values
code
stringlengths
2
1.01M
tokens
int64
2
598k
0x5eal/luau-unzip
0x5eal-luau-unzip-5ed3cf9/tests/walk.luau
luau
.luau
local fs = require("@lune/fs") local process = require("@lune/process") local frktest = require("../luau_packages/frktest") local check = frktest.assert.check local ZipReader = require("../lib") local ZIPS = { "tests/data/files_and_dirs.zip", "tests/data/symlink.zip", "tests/data/extended_timestamp.zip", } retur...
596
itsfrank/frktest
itsfrank-frktest-aa72048/examples/arrays.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check return function() test.suite("Arrays", function() test.case("contains", function() local a = { "one", "two", "three", "four", "five" } check.array.contains(a, "eleven") -- check ...
435
itsfrank/frktest
itsfrank-frktest-aa72048/examples/basic_assertions.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check local req = frktest.assert.require return function() test.suite("Passing", function() test.case("The only passing test", function() check.is_true(true) end) end) test.suite(...
470
itsfrank/frktest
itsfrank-frktest-aa72048/examples/errors.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check return function() test.suite("Errors", function() test.case("throwing", function() error("some error") -- errors end a test end) test.case("should error", function() ...
127
itsfrank/frktest
itsfrank-frktest-aa72048/examples/focus.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check -- use test.focus variants of the case/suire functions to temporarily skip all but one test/suite return function() -- can be used on suites to run only one suite test.focus.suite("Only run me [suite]", fun...
192
itsfrank/frktest
itsfrank-frktest-aa72048/examples/messages.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check local req = frktest.assert.require local msg = frktest.assert.msg return function() test.suite("Messages", function() test.case("Print message if assertion fails", function() check.equal(10,...
313
itsfrank/frktest
itsfrank-frktest-aa72048/examples/parametrized.luau
luau
.luau
-- parametrized testing, also known as 'data driven tests' or 'table driven tests' -- quite popular in the golang community, is a style of testing where the data -- and logic are separated so that you can run the same test logic on multiple -- input/output pairs local frktest = require("@frktest/frktest") local test =...
288
itsfrank/frktest
itsfrank-frktest-aa72048/examples/readme_demo/_run.luau
luau
.luau
function load_tests() require("./the_test")() end function run_tests() local frktest = require("@frktest/frktest") local console_reporter = require("@frktest/reporters/console_reporter") console_reporter.init() frktest.run() end load_tests() run_tests()
69
itsfrank/frktest
itsfrank-frktest-aa72048/examples/readme_demo/the_test.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check local req = frktest.assert.require local msg = frktest.assert.msg return function() test.suite("A collection of tests", function() test.case("A test that passes", function() local exp = 4 ...
354
itsfrank/frktest
itsfrank-frktest-aa72048/examples/run/default.luau
luau
.luau
function load_tests() -- tests execute in the order they are loaded require("../suites_cases")() require("../basic_assertions")() require("../messages")() require("../errors")() require("../parametrized")() require("../arrays")() require("../tables")() require("../skip")() -- req...
245
itsfrank/frktest
itsfrank-frktest-aa72048/examples/run/pesde_entrypoint.luau
luau
.luau
function load_tests() require("../basic_assertions")() end function run_tests() -- same as run, but uses the entrypoint.luau entrypoint script, like a pesde project would local frktest = require("../../src/entrypoint") local console_reporter = frktest.reporters.console_reporter console_reporter.in...
97
itsfrank/frktest
itsfrank-frktest-aa72048/examples/skip.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check -- use test.skip to not run suites/cases return function() -- can be used on suites to skip the entire suite test.skip.suite("This suite will not run", function() test.case("test 1", function() ...
159
itsfrank/frktest
itsfrank-frktest-aa72048/examples/suites_cases.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check return function() -- use suites to group test cases together test.suite("A collection of test cases", function() test.case("case 1", function() check.is_true(false) end) ...
148
itsfrank/frktest
itsfrank-frktest-aa72048/examples/tables.luau
luau
.luau
local frktest = require("@frktest/frktest") local test = frktest.test local check = frktest.assert.check return function() test.suite("Tables", function() test.case("value equal", function() local a = { foo = 1 } local b = { foo = 1 } local c = a check.equal(...
574
itsfrank/frktest
itsfrank-frktest-aa72048/src/assert.luau
luau
.luau
local types = require("./types") type Failure = types.Failure local _state = {} _state.listeners = {} _state.listeners.check_failed = {} :: { (Failure) -> nil } _state.listeners.require_failed = {} :: { (Failure) -> nil } _state.current_user_msg = nil :: string? local test = require("./test") function exec_listener...
990
itsfrank/frktest
itsfrank-frktest-aa72048/src/assert_impl.luau
luau
.luau
local types = require("./types") local utils = require("./utils") type Failure = types.Failure type DiffEntry<T> = types.DiffEntry<T> type TableDiff = types.TableDiff local assert_impl = {} function make_failure(message: string): Failure local file, line = debug.info(5, "sl") return { location = { ...
1,810
itsfrank/frktest
itsfrank-frktest-aa72048/src/entrypoint.luau
luau
.luau
-- i'm not a fan of having a single entrypoint, but this seems to be idiomatic for pesde/wally -- with this, reporters will be acessible to folks who want to consume the lib through a single entrypoint local frktest = require("./frktest") local console_reporter = require("./reporters/console_reporter") type ConsoleRep...
222
itsfrank/frktest
itsfrank-frktest-aa72048/src/frktest.luau
luau
.luau
local frktest = {} local test = require("./test") local assert = require("./assert") -- make sure to initalize a reporter before running, otherwise you will get no output -- see `src/reporters` for builtin reporters available -- returns false if any test failed, true otherwise frktest.run = function(): boolean te...
104
itsfrank/frktest
itsfrank-frktest-aa72048/src/reporters/console_reporter.luau
luau
.luau
-- usage: -- local reporter = require("@frktest/reporters/console_reporter") -- reporter.init() -- -- run tests local types = require("../types") local utils = require("../utils") local inspect = require("../lib/inspect") local color = require("./runtimes/color") type Failure = types.Failure type DiffEntr...
1,611
itsfrank/frktest
itsfrank-frktest-aa72048/src/reporters/lune_console_reporter.luau
luau
.luau
-- file is kept here for backwards compatibility warn("[DEPRECATED] lune_console_reporter is deprecated, use console_reporter instead\n") return require("./console_reporter")
36
itsfrank/frktest
itsfrank-frktest-aa72048/src/reporters/runtimes/color.luau
luau
.luau
local runtime = require("./get_runtime")() type Color = "red" | "green" | "yellow" | "purple" type ColorFn = (Color, string) -> string -- default, fallback to plain print local color: ColorFn = function(_, s: string) return s end if runtime == "lune" then local stdio = require("@lune/stdio") color = func...
304
itsfrank/frktest
itsfrank-frktest-aa72048/src/reporters/runtimes/get_runtime.luau
luau
.luau
export type Runtime = "lune" | "zune" | "lute" | "unknown" return function(): Runtime if type(_VERSION) == "string" and string.sub(_VERSION, 1, 4) == "Lune" then return "lune" elseif type(_VERSION) == "string" and string.sub(_VERSION, 1, 4) == "Zune" then return "zune" else -- test ...
165
itsfrank/frktest
itsfrank-frktest-aa72048/src/test.luau
luau
.luau
local types = require("./types") local utils = require("./utils") local test = {} type Test = types.Test type Suite = types.Suite type ExecCounts = types.ExecCounts type ExecResult = types.ExecResult type TestError = types.TestError local _state = {} _state.suites = {} :: { Suite } _state.global_suite = {} :: { Test...
1,836
itsfrank/frktest
itsfrank-frktest-aa72048/src/types.luau
luau
.luau
type Location = { file: string, line: string, } export type Failure = { location: Location, message: string, user_msg: string?, complex_info: { type: string, data: any, }?, } export type DiffEntry<T> = { k: any, t: "+" | "-" | "~", v: T | { a: T, b: T }, -- latt...
265
itsfrank/frktest
itsfrank-frktest-aa72048/src/utils.luau
luau
.luau
local utils = {} function utils.trim(s: string): string return (s:gsub("^%s*(.-)%s*$", "%1")) end function utils.make_indent(i: number): string local spaces = " " local s = "" for j = 0, i - 1 do s = s .. spaces end return s end function utils.multiline_to_array(s: string): { strin...
209
Ince-FS/Fast-Minkowski-Shapecast
Ince-FS-Fast-Minkowski-Shapecast-527ffab/src/Geometry/LinearConvexCast.luau
luau
.luau
--!native --!strict local MAX_ITERATIONS: number = 256 local function getABV( originA: CFrame, marginA: number, invA: CFrame, localSupportA: any, originB: CFrame, marginB: number, invB: CFrame, localSupportB: any, n: Vector3 ): (Vector3, Vector3, Vector3) local m = n:Dot(n) do if m > 0 then n /= m^0.5 end ...
1,183
Ince-FS/Fast-Minkowski-Shapecast
Ince-FS-Fast-Minkowski-Shapecast-527ffab/src/Shapes/Ball.luau
luau
.luau
--!strict type Ball = { Shape: string, Margin: number, Transform: CFrame, Radius: number, fromPart: (basePart: BasePart) -> Ball, localSupport: (n: Vector3) -> Vector3 } return function(): Ball local self: Ball = { Shape = 'Ball', Margin = 0, Transform = CFrame.identity, Radius = 0 } :: Ball f...
170
Ince-FS/Fast-Minkowski-Shapecast
Ince-FS-Fast-Minkowski-Shapecast-527ffab/src/Shapes/Block.luau
luau
.luau
--!strict type Block = { Shape: string, Margin: number, Transform: CFrame, Extent: Vector3, fromPart: (basePart: BasePart) -> Block, localSupport: (n: Vector3) -> Vector3 } return function(): Block local self: Block = { Shape = 'Block', Margin = 0, Transform = CFrame.identity, Extent = Vector3.zer...
214
Ince-FS/Fast-Minkowski-Shapecast
Ince-FS-Fast-Minkowski-Shapecast-527ffab/src/Shapes/CornerWedge.luau
luau
.luau
--!strict type CornerWedge = { Shape: string, Margin: number, Transform: CFrame, Extent: Vector3, fromPart: (basePart: BasePart) -> CornerWedge, localSupport: (n: Vector3) -> Vector3 } local _vertices: {Vector3} = { Vector3.new(1, 1, -1), Vector3.new(-1, -1, 1), Vector3.new(1, -1, -1), Vector3.new(-1, -1,...
332
Ince-FS/Fast-Minkowski-Shapecast
Ince-FS-Fast-Minkowski-Shapecast-527ffab/src/Shapes/Cylinder.luau
luau
.luau
--!strict type Cylinder = { Shape: string, Margin: number, Transform: CFrame, Height: number, Radius: number, fromPart: (basePart: BasePart) -> Cylinder, localSupport: (n: Vector3) -> Vector3 } return function(): Cylinder local self: Cylinder = { Shape = 'Cylinder', Margin = 0, Transform = CFrame.i...
268
Ince-FS/Fast-Minkowski-Shapecast
Ince-FS-Fast-Minkowski-Shapecast-527ffab/src/Shapes/Wedge.luau
luau
.luau
--!strict type Wedge = { Shape: string, Margin: number, Transform: CFrame, Extent: Vector3, fromPart: (basePart: BasePart) -> Wedge, localSupport: (n: Vector3) -> Vector3 } local _vertices: {Vector3} = { Vector3.new( 1, 1, 1), Vector3.new(-1, 1, 1), Vector3.new(-1, -1, 1), Vector3.new( 1, -1, -1), Ve...
345
Nicell/luau.page
Nicell-luau.page-bfb8f64/scripts/update.luau
luau
.luau
local cf = require("./cloudflare") local porkbun = require("./porkbun") local cname = require("../cname") local success, oldCname = pcall(function() return require("../cname-old") :: cname.Entries end) if not success then print("No old cname file found, creating a new one.") oldCname = {} end local function intoE...
382
Nicell/luau.page
Nicell-luau.page-bfb8f64/site/build.luau
luau
.luau
local fs = require("@std/fs") local site = require("./") if not fs.exists("dist") then fs.createDirectory("dist") end fs.writeStringToFile("dist/index.html", site())
42
Nicell/luau.page
Nicell-luau.page-bfb8f64/site/dev.luau
luau
.luau
local net = require("@lute/net/server") local fs = require("@std/fs") local process = require("@std/process") local task = require("@std/task") process.run({ "lute", "site/build.luau" }) local server = net.serve(function() return fs.readFileToString("dist/index.html") end) local watcher = fs.watch("site/init.luau")...
133
Roblox/picomatch-lua
Roblox-picomatch-lua-92877d2/bin/spec.lua
luau
.lua
local ProcessService = game:GetService("ProcessService") local Packages = script.Parent.PicomatchTestModel.Packages local JestGlobals = require(Packages.Dev.JestGlobals) local TestEZ = JestGlobals.TestEZ -- Run all tests, collect results, and report to stdout. local result = TestEZ.TestBootstrap:run( { Packages.Pic...
122
Roblox/picomatch-lua
Roblox-picomatch-lua-92877d2/src/stringUtils.lua
luau
.lua
-- ROBLOX NOTE: no upstream -- ROBLOX TODO: implement in LuauPolyfill local CurrentModule = script.Parent local Packages = CurrentModule.Parent local LuauPolyfill = require(Packages.LuauPolyfill) local Array = LuauPolyfill.Array type Array<T> = LuauPolyfill.Array<T> local RegExp = require(Packages.RegExp) type RegEx...
451
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/boolean_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local boolean_constant = {} boolean_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_BOOLEAN boolean_constant.__index = boolean_constant function boolean_constant.new(value: boolean) return setmetatable({ value = value }, boolean_constant) end f...
97
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/closure_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local closure_constant = {} closure_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_CLOSURE closure_constant.__index = closure_constant function closure_constant.new(value: number) return setmetatable({ value = value }, closure_constant) end fu...
103
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/import_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local string_constant_class = require("string_constant") local import_constant = {} import_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_IMPORT import_constant.__index = import_constant function import_constant.new(value: { string_constant_class.C...
144
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/nil_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local nil_constant = {} nil_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_NIL nil_constant.__index = nil_constant function nil_constant.new() return setmetatable({}, nil_constant) end function nil_constant:__tostring() return "nil" end e...
87
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/number_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local number_constant = {} number_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_NUMBER number_constant.__index = number_constant function number_constant.new(value: number) return setmetatable({ value = value }, number_constant) end function ...
97
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/string_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local string_constant = {} string_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_STRING string_constant.__index = string_constant function string_constant.new(value: string) return setmetatable({ value = value }, string_constant) end function ...
99
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/table_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local table_constant = {} table_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_TABLE table_constant.__index = table_constant function table_constant.new(value: { any }) return setmetatable({ value = value }, table_constant) end function table_...
107
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/constants/vector_constant.luau
luau
.luau
local luau_spec = require("../../luau/spec") local vector_constant = {} vector_constant.__constant_type = luau_spec.LuauBytecodeConstants.LBC_CONSTANT_VECTOR vector_constant.__index = vector_constant function vector_constant.new(x: number, y: number, z: number, w: number) return setmetatable({ x= x, y = y, z = z,...
136
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/debug_info.luau
luau
.luau
export type DebugLocal = { name: string, -- var_int (string_table) start_pc: number, -- var_int end_pc: number, -- var_int, reg: number, -- byte } export type DebugUpval = { name: string, -- var_int (string_table) } export type DebugLocalsTable = { debug_locals_size: number, deb...
456
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/instruction.luau
luau
.luau
export type Registers = { A: number, B: number, C: number, D: number, E: number, } local luau_spec = require("../luau/spec") local binary_reader_class = require("../utilities/binary_reader") local instruction = {} instruction.__index = instruction local function arshift(x: number, disp: number): ...
373
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/line_info.luau
luau
.luau
local binary_reader_class = require("../utilities/binary_reader") local instruction_class = require("../classes/instruction") export type FunctionInstructionsTable = { instructions_size: number, instructions: { instruction_class.Class } } local line_info = {} line_info.__index = line_info function line_info....
375
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/string_table.luau
luau
.luau
local binary_reader_class = require("../utilities/binary_reader") local string_table = {} string_table.__index = string_table function string_table.new(binary_reader: binary_reader_class.Class) local self = setmetatable({}, string_table) self.string_count = binary_reader:read_var_int() self.strings = tab...
119
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/classes/version.luau
luau
.luau
local binary_reader_class = require("../utilities/binary_reader") local luau_spec = require("../luau/spec") local version = {} version.__index = version function version.new(binary_reader: binary_reader_class.Class) local self = setmetatable({}, version) self.bytecode_version = binary_reader:read_u8() if...
303
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/init.luau
luau
.luau
export type UserdataType = { index: number, name_ref: number, } local binary_reader_class = require("utilities/binary_reader") local version_class = require("classes/version") local string_table_class = require("classes/string_table") local func_class = require("classes/func") local deserializer = {} deserial...
411
Lovreware/Platinum
Lovreware-Platinum-7f415b3/deserializer/luau/spec.luau
luau
.luau
local LuauOpcode = { -- NOP: noop LOP_NOP = { index = 0, name = "NOP", has_aux = false }, -- BREAK: debugger break LOP_BREAK = { index = 1, name = "BREAK", has_aux = false }, -- LOADNIL: sets register to nil -- A: target register LOP_LOADNIL = { index = 2, name = "LOADNIL", has_aux = false...
5,779
Lovreware/Platinum
Lovreware-Platinum-7f415b3/examples/print.luau
luau
.luau
print("Hello world")
5
Lovreware/Platinum
Lovreware-Platinum-7f415b3/examples/print2.luau
luau
.luau
while true do end
5
Heliodex/coputer
Heliodex-coputer-78e0c4e/ast/format/src/extension.ts
roblox-ts
.ts
// The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below import * as vscode from "vscode" import { formatContent, formatFile } from "./format" // This method is called when your extension is activated // Your extension is activated the...
435
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/examples/local-storage.luau
luau
.luau
local chrome = require("../src") local browser = chrome.browser.create() local tab = browser:create_tab() tab:navigate_to("https://www.wikipedia.org"):wait_until_navigated() local item = tab:get_storage("translationHash") :: string print(item) browser:close()
58
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/examples/print-to-pdf.luau
luau
.luau
local process = require("@lune/process") local fs = require("@lune/fs") local chrome = require("../src") local WEBSOCKET_URL = assert(process.args[1], "Must provide websocket url") local FILE_PATH = assert(process.args[2], "Must provide path/to/file/index.html") local browser = chrome.browser.connect(WEBSOCKET_URL) l...
165
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/examples/query-wikipedia.luau
luau
.luau
local chrome = require("../src") local browser = chrome.browser.create({ -- The searchbar won't appear if the resolution is too low window_size = { width = 1600, height = 768 }, }) local function query(input: string) local tab = browser:create_tab() tab:navigate_to("https://en.wikipedia.org") :wait_until_navig...
191
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/examples/settings-and-event.luau
luau
.luau
local chrome = require("../src") local browser = chrome.browser.create({ headless = false }) local tab = browser:create_tab() tab:navigate_to("https://www.google.com"):wait_until_navigated() tab:add_event_listener(chrome.Event.PageLifecycleEvent, function(lifecycle) if lifecycle.name == "DOMContentLoaded" then pr...
77
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/examples/take-screenshot.luau
luau
.luau
local fs = require("@lune/fs") local chrome = require("../src") local browser = chrome.browser.create() local tab = browser:create_tab() local jpeg = tab:navigate_to("https://www.wikipedia.org") :wait_until_navigated() :capture_screenshot({ format = "jpeg", quality = 75, from_surface = true }) fs.writeFile("screens...
162
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/context.luau
luau
.luau
local types = require("./types") export type Context = types.Context local function get_id(context: Context): string return context.id end local function get_tabs(context: Context): { types.Tab } local tabs = {} for _, t in context.browser:get_tabs() do if t:get_browser_context_id() == context.id then table...
187
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/init.luau
luau
.luau
local proc = require("@self/proc") local browser = require("@self/browser") local context = require("@self/context") local tab = require("@self/tab") local polling = require("@self/util/polling") local Method = require("@self/protocol/method") local Event = require("@self/protocol/event") export type LaunchOptions = p...
143
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/proc.luau
luau
.luau
local process = require("@lune/process") local fs = require("@lune/fs") local net = require("@lune/net") local Regex = require("@lune/regex") local tempfile = require("./util/tempfile") local winreg = require("./util/winreg") --[=[ Represents the way in which Chrome is run. By default it will search for a Chrome bin...
2,661
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/tab/box-model.luau
luau
.luau
local types = require("../types") local Page = require("../protocol/page") export type BoxModel = types.BoxModel local function content_viewport(box_model: BoxModel): Page.Viewport return { x = box_model.content.top_left.x, y = box_model.content.top_left.y, width = box_model.content:width(), height = box_mod...
423
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/tab/dialog.luau
luau
.luau
local Transport = require("../transport") local Page = require("../protocol/page") export type Dialog = { session_id: string, transport: Transport.Transport, accept: (dialog: Dialog, text: string?) -> (), dismiss: (dialog: Dialog) -> (), } local function handle(dialog: Dialog, accept: boolean, text: string?) dia...
192
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/tab/element-quad.luau
luau
.luau
local types = require("../types") export type ElementQuad = types.ElementQuad local function height(element_quad: ElementQuad): number return element_quad.bottom_left.y - element_quad.top_left.y end local function width(element_quad: ElementQuad): number return element_quad.top_right.x - element_quad.top_left.x en...
928
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/tab/element.luau
luau
.luau
local element_quad = require("./element-quad") local box_model = require("./box-model") local polling = require("../util/polling") local types = require("../types") local DOM = require("../protocol/dom") local Runtime = require("../protocol/runtime") export type Element = types.Element local DEFAULT_TIMEOUT = 3 loca...
2,314
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/tab/keys.luau
luau
.luau
export type KeyDefinition = { code: string?, key: Key, key_code: number?, text: string?, } export type Key = "Tab" | "*" | "MediaPlayPause" | "`" | "Help" | "End" | "NonConvert" | "Alt" | '"' | "MediaTrackPrevious" | "F2" | "AltGraph" | "," | "|" | "Execute" | "t" | "Enter" | "." | "Meta" | "?"...
7,282
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/util/casing.luau
luau
.luau
local function transform(x: any, processor: (string) -> string): any if typeof(x) == "string" then return processor(x) elseif typeof(x) == "table" then local clone = {} for key, value in x do if typeof(value) == "table" then value = transform(value, processor) end clone[transform(key, processor)] ...
256
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/util/polling.luau
luau
.luau
local task = require("@lune/task") export type Polling = { timeout: number, sleep: number, pause_until: <T>(self: Polling, try: () -> T?) -> T?, } local DEFAULT_TIMEOUT = 10 local DEFAULT_SLEEP = 1 / 10 local function pause_until<T>(polling: Polling, try: () -> T?): T? local start = os.clock() while true do ...
265
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/util/tempfile.luau
luau
.luau
local process = require("@lune/process") local fs = require("@lune/fs") local NUM_RANDOM_CHARS = 6 local NUM_RETRIES = 2 ^ 31 local ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" local function assert_temp(): string if not process.env.TEMP then error("Missing TEMP variable") end if ...
265
synpixel/chrome.luau
synpixel-chrome.luau-8dacaf1/src/util/winreg.luau
luau
.luau
--[[ MIT License Copyright (c) 2024-present jiwonz 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, ...
1,097
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