repo stringclasses 302
values | file_path stringlengths 18 241 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 76 697k | tokens int64 10 271k |
|---|---|---|---|---|---|
OMouta/PyLua | OMouta-PyLua-e6fed0e/src/PyLua/vm/interpreter/dispatcher.luau | luau | .luau | local FrameModule = require("../frame")
local Stack = require("../stack")
local Base = require("../../objects/base")
local Collections = require("../../objects/collections")
local ObjBuiltins = require("../../objects/builtins")
local ClassBuilder = require("../../objects/class_builder")
local Exceptions = require("../.... | 6,819 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/src/PyLua/vm/interpreter/generator.luau | luau | .luau | local Base = require("../../objects/base")
local FrameModule = require("../frame")
local State = require("./state")
local Generator = {}
export type PyObject = Base.PyObject
export type VMState = State.VMState
export type ResumeFunction = (
vm: VMState,
frame: FrameModule.Frame,
instruction: any,
constants: { an... | 1,070 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/src/PyLua/vm/interpreter/helpers.luau | luau | .luau | local Base = require("../../objects/base")
local Helpers = {}
export type PyObject = Base.PyObject
local function isPyObject(value: any): boolean
return type(value) == "table" and value.__type ~= nil and value.__typeobj ~= nil
end
local function coercePyObject(value: any): PyObject
if isPyObject(value) then
ret... | 1,270 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/src/PyLua/vm/interpreter/iteration.luau | luau | .luau | local Base = require("../../objects/base")
local Iteration = {}
local ITERATOR_TYPES = {
list_iterator = true,
tuple_iterator = true,
set_iterator = true,
dict_iterator = true,
str_iterator = true,
}
export type PyObject = Base.PyObject
function Iteration.createIterator(iterable: any): any
local obj = iterabl... | 1,002 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/src/PyLua/vm/interpreter/state.luau | luau | .luau | local FrameModule = require("../frame")
local State = {}
export type Frame = FrameModule.Frame
export type VMState = {
current_frame: Frame?,
call_stack: { Frame },
globals: { [string]: any },
builtins: { [string]: any },
return_value: any,
}
function State.newState(globals: { [string]: any }?, builtins: { [st... | 131 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/src/PyLua/vm/stack.luau | luau | .luau | local Stack = {}
-- Value stack for VM operations
export type Stack = {
values: { any },
top: number,
}
-- Create a new stack
function Stack.new(): Stack
return {
values = {},
top = 0,
}
end
-- Push value onto stack
function Stack.push(stack: Stack, value: any)
stack.top = stack.top + 1
stack.values[stack.... | 789 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/framework.luau | luau | .luau | --!strict
-- PyLua Test Framework
-- Simple testing utilities for PyLua development
local TestFramework = {}
-- Configuration (can be overridden via configure())
export type FrameworkConfig = {
showPassed: boolean?, -- Print each passed assertion
color: boolean?, -- Use ANSI colors
showFailuresInline: boolean?, --... | 1,430 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/run_tests.luau | luau | .luau | --!strict
-- PyLua Test Runner
local TestFramework = require("./framework")
-- Aggregate run: disable per-suite summary; final summary printed manually
TestFramework.configure({ showPassed = false, color = true, showFailuresInline = false, autoSummaryPerFile = false })
require("./suites/test_api")
require("./suites/t... | 220 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_api.luau | luau | .luau | --!strict
-- PyLua API Tests
-- Test the main PyLua API interface
local TestFramework = require("../framework")
local PyLua = require("../../src/PyLua")
-- Test suite for PyLua API
local apiTests: TestFramework.TestSuite = {
name = "PyLua API Tests",
tests = {
{
name = "Create Runtime Instance",
test = func... | 632 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_ast.luau | luau | .luau | --!strict
-- PyLua AST System Tests
-- Phase 1.3 - Test AST node creation and visitor pattern
local TestFramework = require("../framework")
local nodes = require("../../src/PyLua/ast/nodes")
local visitor = require("../../src/PyLua/ast/visitor")
local astTests = {
name = "PyLua AST Tests",
tests = {
{
name = "... | 944 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_bytecode.luau | luau | .luau | --!strict
-- PyLua Bytecode / Compiler Tests (Phase 4.1 minimal subset)
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local Compiler = require("../../src/PyLua/compiler")
local instr = require("../../src/PyLua/bytecode/inst... | 2,088 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_classes.luau | luau | .luau | --!strict
-- Tests for Python class definitions and inheritance
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local Compiler = require("../../src/PyLua/compiler")
local Interpreter = require("../../src/PyLua/vm/interpreter"... | 924 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_control_flow.luau | luau | .luau | --!strict
-- Tests for control flow statements (if, while, for, break, continue)
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local Compiler = require("../../src/PyLua/compiler")
local Interpreter = require("../../src/PyLu... | 3,053 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_error_reporting.luau | luau | .luau | --!nocheck
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local errorTests = {
name = "Error Reporting Tests",
tests = {
{
name = "Parse Error with Line Number (Indentation)",
test = function()
local code = "x ... | 421 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_exceptions.luau | luau | .luau | --!strict
-- Tests for exception handling (try/except)
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local Compiler = require("../../src/PyLua/compiler")
local Interpreter = require("../../src/PyLua/vm/interpreter")
local B... | 1,160 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_functions.luau | luau | .luau | --!strict
-- Tests for Python function support
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local Compiler = require("../../src/PyLua/compiler")
local Interpreter = require("../../src/PyLua/vm/interpreter")
local Builtins ... | 1,559 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_generators.luau | luau | .luau | --!strict
-- Tests for generator functions and yield semantics
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
local Compiler = require("../../src/PyLua/compiler")
local Interpreter = require("../../src/PyLua/vm/interpreter")... | 838 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_interop.luau | luau | .luau | --!strict
-- Interop tests ensure Luau ↔ Python conversions behave as expected
local TestFramework = require("../framework")
local PyLua = require("../../src/PyLua")
local Bridge = require("../../src/PyLua/interop/bridge")
local interopSuite: TestFramework.TestSuite = {
name = "Interop Tests",
tests = {
{
name... | 1,342 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_lexer.luau | luau | .luau | --!strict
-- PyLua Lexer Tests
-- Test the Python tokenization functionality
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local function dedentsBeforeDef(tokens: { any }, targetDefIndex: number): number
local defsSeen = 0
local dedents = 0
for _, token in ipairs(toke... | 2,676 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_modules.luau | luau | .luau | local TestFramework = require("../framework")
local PyLua = require("../../src/PyLua")
local modulesTests: TestFramework.TestSuite = {
name = "Modules",
tests = {
{
name = "import sys",
test = function()
local py = PyLua.new()
py:execute("import sys")
local sysPy = py:getGlobalPy("sys")
TestF... | 694 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_modules_advanced.luau | luau | .luau | local TestFramework = require("../framework")
local PyLua = require("../../src/PyLua")
local advancedModulesTests = {
name = "Advanced Modules",
tests = {
{
name = "Native module import",
test = function()
local nativeMod = {
foo = 42,
bar = function(x: number)
return x * 2
end,
... | 559 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_objects_base.luau | luau | .luau | --!strict
-- PyLua Object System Tests - Phase 3.1 Base Object System
local TestFramework = require("../framework")
local base = require("../../src/PyLua/objects/base")
local tests: TestFramework.TestSuite = {
name = "PyLua Base Object System",
tests = {
{
name = "Create primitive objects via ensurePyObject",
... | 1,079 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_objects_builtins.luau | luau | .luau | --!strict
-- Tests for Phase 3.2 Built-in Types (numbers, strings, booleans, None, type objects placeholder)
local TestFramework = require("../framework")
local base = require("../../src/PyLua/objects/base")
local builtins = require("../../src/PyLua/objects/builtins")
local suite: TestFramework.TestSuite = {
name = ... | 1,694 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_objects_collections.luau | luau | .luau | --!strict
-- Tests for Phase 3.3 Collections
local TestFramework = require("../framework")
local base = require("../../src/PyLua/objects/base")
local builtins = require("../../src/PyLua/objects/builtins")
local collections = require("../../src/PyLua/objects/collections")
local PyLua = require("../../src/PyLua")
local... | 3,406 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_parser.luau | luau | .luau | --!nocheck
-- PyLua Parser Tests - Phase 2.1 Expression Parser
-- Test the expression parsing functionality
local TestFramework = require("../framework")
local Lexer = require("../../src/PyLua/lexer")
local Parser = require("../../src/PyLua/parser")
-- Test suite for PyLua Parser
local parserTests: TestFramework.Test... | 6,267 |
OMouta/PyLua | OMouta-PyLua-e6fed0e/tests/suites/test_vm.luau | luau | .luau | --!strict
-- PyLua Virtual Machine Tests
-- Tests for Phase 4 - VM execution
local TestFramework = require("../framework")
local Interpreter = require("../../src/PyLua/vm/interpreter")
local Frame = require("../../src/PyLua/vm/frame")
local Stack = require("../../src/PyLua/vm/stack")
local Instructions = require("../.... | 3,738 |
dphfox/lingua | dphfox-lingua-575ec37/examples/01-hello-lingua/lune/build-this-example.luau | luau | .luau | --!nocheck
--selene: allow(incorrect_standard_library_use)
local build_single_example = require("../../build-examples/build_single_example")
build_single_example("01-hello-lingua", "bin") | 44 |
dphfox/lingua | dphfox-lingua-575ec37/examples/01-hello-lingua/src-luau/add_panic_handler.luau | luau | .luau | -- When Rust panics, it doesn't exit helpfully by default. This function gives
-- the Rust side an external function it can call with details of the panic,
-- so the error can be emitted on the Luau side instead.
return function(extern_fns)
local current_panic = nil
function extern_fns.panic_reporter(
len_or_byte:... | 160 |
dphfox/lingua | dphfox-lingua-575ec37/examples/02-simple-library/lune/build-this-example.luau | luau | .luau | --!nocheck
--selene: allow(incorrect_standard_library_use)
local build_single_example = require("../../build-examples/build_single_example")
build_single_example("02-simple-library", "lib") | 41 |
dphfox/lingua | dphfox-lingua-575ec37/examples/02-simple-library/src-luau/init.server.luau | luau | .luau | --!nocheck
-- See src/lib.rs for an introduction to this example.
local library = require(script.library)
local prices = {
apple = 10,
orange = 5,
banana = 25
}
local fridge = {
"apple",
"apple",
"banana",
"orange",
"apple",
"orange",
"orange",
"banana",
"banana"
}
local fridge_value = library.calculate_... | 163 |
dphfox/lingua | dphfox-lingua-575ec37/examples/02-simple-library/src-luau/library.luau | luau | .luau | local lingua = require(script.Parent.Parent.lingua)
local library_wasm_loader = require(script.Parent.Parent.target_luau.example_wasm)
local add_panic_handler = require(script.Parent.add_panic_handler)
local wasm_env = { func_list = {} }
add_panic_handler(wasm_env.func_list)
local finish_lingua_init = lingua.init(was... | 202 |
dphfox/lingua | dphfox-lingua-575ec37/examples/build-examples/build_single_example.luau | luau | .luau | -- Lune-style imports make both Luau LSP and Selene very unhappy...
--!nocheck
--!nolint LocalShadow
--selene: allow(incorrect_standard_library_use)
local process = require("@lune/process")
--selene: allow(incorrect_standard_library_use)
local stdio = require("@lune/stdio")
--selene: allow(incorrect_standard_library_us... | 923 |
dphfox/lingua | dphfox-lingua-575ec37/luau/lingua.luau | luau | .luau | --!strict
--Licensed under BSD3 from Lingua, (c) Daniel P H Fox 2024
--------------------------------------------------------------------------------
-- TYPE DEFINITIONS ------------------------------------------------------------
--------------------------------------------------------------------------------
-- Typ... | 2,530 |
Nicell/lynx | Nicell-lynx-b8117fc/benchmark.luau | luau | .luau | -- Implementation of this benchmark: https://hono.dev/docs/concepts/benchmarks
local Router = require("@lynx/router")
local router = Router.new()
router:add("GET", "/user", function() end)
router:add("GET", "/user/comments", function() end)
router:add("GET", "/user/avatar", function() end)
router:add("GET", "/user/l... | 608 |
Nicell/lynx | Nicell-lynx-b8117fc/src/middleware/compress.luau | luau | .luau | local serde = require("@lune/serde")
local Context = require("../context")
type Context = Context.Context
local ENCODINGS: { { name: string, encode: serde.CompressDecompressFormat } } = {
{
name = "br",
encode = "brotli",
},
{
name = "gzip",
encode = "gzip",
},
}
local function compress()
return function... | 214 |
Nicell/lynx | Nicell-lynx-b8117fc/src/middleware/logger.luau | luau | .luau | local datetime = require("@lune/datetime")
local process = require("@lune/process")
local Context = require("../context")
type Context = Context.Context
local Types = require("@lynx/types")
type Middleware = Types.Middleware
local color = if process.env.NO_COLOR then false else true
local function dim(string: string)... | 432 |
Nicell/lynx | Nicell-lynx-b8117fc/src/router.luau | luau | .luau | local Node = require("./node")
type Node = Node.Node
local Types = require("./types")
type Handler = Types.Handler
type Middleware = Types.Middleware
local Router = {}
Router.__index = Router
type RouterData = {
node: Node,
}
export type Router = typeof(setmetatable({} :: RouterData, Router))
function Router.new(... | 206 |
Nicell/lynx | Nicell-lynx-b8117fc/src/static.luau | luau | .luau | local fs = require("@lune/fs")
local Context = require("./context")
type Context = Context.Context
-- From https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
local mimeTypes = {
aac = "audio/aac",
abw = "application/x-abiword",
apng = "image/apng",
arc = "application/x-freearc... | 1,050 |
ffrostfall/luausignal | ffrostfall-luausignal-ce028cb/benches/libs/goodsignal.luau | luau | .luau | --!optimize 2
--!native
--------------------------------------------------------------------------------
-- Batched Yield-Safe Signal Implementation --
-- This is a Signal class which has effectively identical behavior to a --
-- normal RBXScriptSignal, with the only difference b... | 1,475 |
ffrostfall/luausignal | ffrostfall-luausignal-ce028cb/benches/signal.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local goodsignal = require(ReplicatedStorage.benches.libs.goodsignal)
local luausignal = require(ReplicatedStorage.signal)
return {
Functions = {
["luausignal constructor"] = function()
local _s
for i = 1, 500 do
_s =... | 663 |
ffrostfall/luausignal | ffrostfall-luausignal-ce028cb/lune/tests.luau | luau | .luau | local process = require("@lune/process")
local signal_spec = require("@tests/signal.spec")
-- if signal_spec then
-- process.exit(0)
-- else
-- process.exit(1)
-- end
| 46 |
ffrostfall/luausignal | ffrostfall-luausignal-ce028cb/src/init.luau | luau | .luau | --!optimize 2
--!native
local task = task or require("@lune/task")
local tspawn = task.spawn
local free_thread: thread? = nil
local function deleted_signal_err()
error("Cannot fire a deleted signal", 2)
end
local error_tbl = {
fire = deleted_signal_err,
connect = deleted_signal_err,
once = deleted_signal_err,
... | 1,359 |
ffrostfall/luausignal | ffrostfall-luausignal-ce028cb/vendor/testkit.luau | luau | .luau | --!nocheck
--!nolint
-------------------------------------------------------------------------------
-- testkit.luau
-- v0.7.3
--------------------------------------------------------------------------------
local color = {
white_underline = function(s: string)
return `\27[1;4m{s}\27[0m`
end,
white = function(s... | 2,781 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/cli/command.luau | luau | .luau | -- warmluau
-- darklua but warm and luau
-- by checkraisefold
local PROJECT_FILE_EXTENSION = "warm.luau"
local PROJECT_FILE_MATCH = "^(.*)%.warm%.luau?$"
local cli = require("@batteries/cli")
local defs = require("@warmluau/")
local filesystem = require("@lute/fs")
local fspath = require("@util/fspath")
local luau = r... | 1,261 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/cli/options.luau | luau | .luau | local cli = require("@batteries/cli")
local function add_options(parser: cli.Parser)
parser:add("help", "flag", {
help = "get help",
aliases = { "h" },
})
parser:add("version", "flag", {
help = "get the version",
aliases = { "v" },
})
parser:add("bake", "flag", {
help = "base mode (bake)",
aliases = {... | 266 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/ingredients/append_comment.luau | luau | .luau | local warmluau = require("@warmluau/")
export type Mode = "early" | "late"
export type Opts = {
text: string,
mode: Mode?,
}
return {} :: warmluau.Ingredient<Opts>
| 53 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/ingredients/resolve_constant.luau | luau | .luau | local analyzer = require("@util/syntax/analyzer")
local warmluau = require("@warmluau/")
export type ImportValue =
| string --
| number
| boolean
| vector
export type ImportChain = {
value: ImportValue | {
literal: analyzer.ConstantData,
}?,
index: {
[string]: ImportValue | ImportChain,
}?,
_const: analy... | 127 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/ingredients/resolve_control.luau | luau | .luau | local warmluau = require("@warmluau/")
export type Opts = {
functions: boolean?,
variables: boolean?,
branches: boolean?,
loops: boolean?,
}
return {} :: warmluau.Ingredient<Opts>
| 55 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/ingredients/resolve_require.luau | luau | .luau | local warmluau = require("@warmluau/")
export type IndexingStyle = "waitforchild" | "property"
export type Opts = {
sourcemap_path: string,
indexing: IndexingStyle?,
}
return {} :: warmluau.Ingredient<Opts>
| 64 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/init.luau | luau | .luau | local filesystem = require("@lute/fs")
local parser = require("@util/syntax/parser")
export type Ast = parser.Ast
export type AstExpr = parser.AstExpr
export type Parsley = parser.Parsley
export type LoadedProject = (require: <Path>(target: Path, ...never) -> unknown) -> ...unknown
export type File = {
read parsed:... | 467 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/syntax/analyzer.luau | luau | .luau | local analyzer = require("@util/syntax/analyzer")
export type UnaryOperator = analyzer.UnaryOperator
export type BinaryOperator = analyzer.BinaryOperator
export type UnknownConstant = analyzer.UnknownConstant
export type NilConstant = analyzer.NilConstant
export type BooleanConstant = analyzer.BooleanConstant
export t... | 151 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/syntax/parser.luau | luau | .luau | local parser = require("@util/syntax/parser")
export type Ast = parser.Ast
export type AstExpr = parser.AstExpr
export type Parsley = parser.Parsley
return {} :: typeof(parser)
| 44 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/syntax/printer.luau | luau | .luau | local printer = require("@util/syntax/printer")
return {} :: typeof(printer)
| 18 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/defs/syntax/visitors.luau | luau | .luau | local visitors = require("@util/syntax/visitors")
export type Base<State = unknown> = visitors.Base<State>
export type AddType = visitors.AddType
export type AddScope = visitors.AddScope
export type Create<State = unknown> = visitors.Create<State>
return {} :: typeof(visitors)
| 61 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/ext/batteries/cli.luau | luau | .luau | local cli = {}
cli.__index = cli
type ArgKind = "positional" | "flag" | "option"
type ArgOptions = {
help: string?,
aliases: { string }?,
default: string?,
required: boolean?,
}
type ArgData = {
name: string,
kind: ArgKind,
options: ArgOptions,
}
type ParseResult = {
values: { [string]: string },
flags: { [... | 1,137 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/ext/batteries/pp.luau | luau | .luau | type ExistingOptions = {
rawStrings: boolean?,
}
local isPrimitiveType = { string = true, number = true, boolean = true }
local typeSortOrder: { [string]: number } = {
["boolean"] = 1,
["number"] = 2,
["string"] = 3,
["function"] = 4,
["vector"] = 5,
["buffer"] = 6,
["thread"] = 7,
["table"] = 8,
["userdata... | 1,213 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/ext/batteries/richterm.luau | luau | .luau | --[[
richterm
terminal ansi formatter
]]
export type Formatter = (s: string, nocolor: boolean?) -> string
-- @noinline (if it ever exists)
local function format(s: string, open: string, close: string, replace: string): string
local index = string.find(s, close, #open + 1, true)
local middle = s
if index then
... | 1,177 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/ingredients/append_comment/init.luau | luau | .luau | local append_comment = require("@warmluau/ingredients/append_comment")
local luau = require("@lute/luau")
local visitors = require("@util/syntax/visitors")
local warmluau = require("@warmluau/")
type Opts = append_comment.Opts
type Mode = append_comment.Mode
-- Luau
local function INSERT<Item>(tbl: { Item }, value: I... | 415 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/ingredients/resolve_constant/replacer.luau | luau | .luau | local luau = require("@lute/luau")
local visitors = require("@util/syntax/visitors")
export type Processor = (luau.AstExpr) -> luau.AstExpr?
type VisitorState = Processor
local function EXHAUSTIVE_MATCH<Msg>(value: never, msg: Msg?): never
error(msg or `Unknown value in exhaustive match: {value}`)
end
local value_v... | 1,607 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/ingredients/resolve_require/init.luau | luau | .luau | local REQUIRE_GLOBAL = "require"
local DEFAULT_INDEXING_STYLE: IndexingStyle = "property"
local convert_require = require("@warmluau/ingredients/resolve_require")
local defs = require("@warmluau/")
local filesystem = require("@lute/fs")
local fspath = require("@util/fspath")
local json = require("@batteries/json")
loc... | 1,276 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/meta.luau | luau | .luau | return {
version = "pre-v0.1.0",
default_project_name = "default.warm.luau",
}
| 25 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/oven/init.luau | luau | .luau | local FAILED_OUTPUT_FILE = "return error('warmluau could not generate an output for this file');"
local defs = require("@warmluau/")
local filesystem = require("@lute/fs")
local fspath = require("@util/fspath")
local luau = require("@lute/luau")
local styled = require("@util/pretty_print")
type Process = index<defs.P... | 1,584 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/oven/recipe.luau | luau | .luau | local defs = require("@warmluau/")
local function recipe_create(...: defs.Recipe | defs.PreparedIngredient): defs.Recipe
local steps: { defs.Recipe | defs.PreparedIngredient } = { ... }
local steps_count = #steps
local function recipe_add(adding: { defs.Recipe | defs.PreparedIngredient }): ()
local adding_count ... | 136 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/require_vfs.luau | luau | .luau | local IMPL: any = nil
local defs = require("@warmluau/")
local requirer = require("@util/requirer")
local dst = requirer.override
local function dir<Children>(children: Children): Children
local children = children :: { [string]: unknown }
for index, value in children do
children[index] = dst(index, value)
end
... | 231 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/colorful.luau | luau | .luau | --[[
Copyright 2024 ffrostfall
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, sublic... | 807 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/fspath/init.luau | luau | .luau | local system = require("@lute/system")
local types = require("@self/types")
export type Nav = types.Nav
export type ValidPath = types.ValidPath
return (if system.os:lower():match("windows") then require("@self/windows") else require("@self/unix")) :: types.Api
| 62 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/fspath/types.luau | luau | .luau | export type Nav = { string }
export type ValidPath = Nav | string
export type Api = {
to_nav: (path: ValidPath) -> Nav,
from_str: (path: string) -> Nav,
clone_nav: (path: ValidPath) -> Nav,
to_str: (path: ValidPath) -> string,
from_nav: (path: Nav) -> string,
has_root: (path: ValidPath) -> boolean,
absolute_eh:... | 271 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/fspath/unix.luau | luau | .luau | local NAVIGATE_BACK = ".."
local NAVIGATE_HERE = "."
local SEPARATOR_MATCH = "/+"
local SEPARATOR = "/"
local types = require("./types")
type ValidPath = types.ValidPath
type Nav = types.Nav
type Api = types.Api
local function to_nav(path: ValidPath): Nav
if type(path) == "table" then
return path
end
return (st... | 1,487 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/fspath/windows.luau | luau | .luau | --!optimize 2
--!native
local NAVIGATE_BACK = ".."
local NAVIGATE_HERE = "."
local SEPARATOR_MATCH = "[/\\]+"
local SEPARATOR = "/"
local types = require("./types")
type ValidPath = types.ValidPath
type Nav = types.Nav
type Api = types.Api
local function to_nav(path: ValidPath): Nav
if type(path) == "table" then
... | 1,539 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/pretty_print/init.luau | luau | .luau | local INDENT = " "
local DEFAULT_PRETTY_PRINT_DECIMALS = 4
-- scientific notation is in base 10, this is the closest power of 10 above 2^53 which is the max integer an f64 (luau
-- number) can accurately represent.
local SCIENTIFIC_NOTATION_THRESHOLD = 10 ^ 16
local colorful = require("./colorful")
local color = co... | 1,551 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/require_resolver/get_aliases.luau | luau | .luau | local filesystem = require("@lute/fs")
local fspath = require("@util/fspath")
local json = require("@batteries/json")
local process = require("@lute/process")
local resolver_types = require("./types")
local styled = require("@util/pretty_print")
type RequireAliases = resolver_types.RequireAliases
local function ASSER... | 636 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/require_resolver/init.luau | luau | .luau | local ALIAS_PATTERN = `^@(.+)`
local filesystem = require("@lute/fs")
local fspath = require("@util/fspath")
local get_aliases = require("@self/get_aliases")
local resolver_types = require("@self/types")
type RequireAliases = resolver_types.RequireAliases
local function ASSERT<Value>(value: Value, message: string?)
... | 1,001 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/requirer/init.luau | luau | .luau | local PREPEND = [[math.randomseed(0); local require = ...;]]
local filesystem = require("@lute/fs")
local fspath = require("@util/fspath")
local luau = require("@lute/luau")
local override = require("@self/override")
local require_resolver = require("@util/require_resolver")
local styled = require("@util/pretty_print"... | 661 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/requirer/override.luau | luau | .luau | local fspath = require("@util/fspath")
local override = {}
local metatable = { __index = override }
type InternalIdentity = setmetatable<{
children: { [string]: InternalIdentity },
path: fspath.Nav,
value: unknown?,
}, typeof(metatable)>
export type Identity<Children = { [string]: InternalIdentity }> = InternalId... | 145 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/sourcemap/init.luau | luau | .luau | local pretty_print = require("@util/pretty_print")
export type Node = {
name: string,
filePaths: { string }?,
children: { Node }?,
}
local function ASSERT<Value, Message>(value: Value, message: Message?)
if value then
return value
end
error(message, 2)
end
-- save repetitive allocations
local reused_nodes_li... | 419 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/analyzer/defs.luau | luau | .luau | local luau = require("@lute/luau")
export type UnaryOperator = "not" | "-" | "#"
export type BinaryOperator =
| "^"
| "*"
| "/"
| "//"
| "%"
| "+"
| "-"
| ".."
| "<"
| ">"
| "<="
| ">="
| "~="
| "=="
| "and"
| "or"
export type UnknownConstant = {
read kind: "unknown",
read data: nil,
}
export type ... | 480 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/analyzer/init.luau | luau | .luau | local defs = require("@self/defs")
local luau = require("@lute/luau")
local var_tracking = require("@self/var_tracking")
export type UnaryOperator = defs.UnaryOperator
export type BinaryOperator = defs.BinaryOperator
export type UnknownConstant = defs.UnknownConstant
export type NilConstant = defs.NilConstant
export t... | 4,474 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/analyzer/var_tracking.luau | luau | .luau | local defs = require("./defs")
local luau = require("@lute/luau")
local visitors = require("@util/syntax/visitors")
type Variable = defs.Variable
type Tracked = defs.Tracked
type Scope = { [string]: Variable? }
type VisitorState = {
tracked: Tracked,
scopes: { Scope },
}
-- Luau
local function INSERT<Item>(tbl: {... | 947 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/parser.luau | luau | .luau | --!strict
local luau = require("@lute/luau")
export type Ast = luau.AstStatBlock
export type AstExpr = luau.AstExpr
export type Parsley = {
root: Ast,
eof: luau.Eof,
}
local function parse(source: string): Ast
return luau.parse(source).root
end
local function parseexpr(source: string): AstExpr
return luau.parsee... | 148 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/tokentool.luau | luau | .luau | local luau = require("@lute/luau")
local visitors = require("@util/syntax/visitors")
local first_last_visitor = visitors.create() :: visitors.Create<{
first: luau.Token,
last: luau.Token,
}?>
function first_last_visitor.vtoken(node): ()
local state = first_last_visitor.state
if state then
state.last = node
els... | 585 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/triviatool.luau | luau | .luau | local luau = require("@lute/luau")
local visitors = require("@util/syntax/visitors")
type VisitorState = {
leading: { luau.Trivia },
trailing: { luau.Trivia },
}
local visitor = visitors.create() :: visitors.Create<VisitorState>
local function add_token(token: luau.Token<string>): ()
local leading = token.leadingt... | 639 |
checkraisefold/warmluau | checkraisefold-warmluau-f168882/src/util/syntax/visitors.luau | luau | .luau | local luau = require("@lute/luau")
export type Base<State = unknown> = {
state: State,
read visit_ast_block: (self: Base<State>, node: luau.AstStatBlock, state: State) -> State,
read visit_ast_statement: (self: Base<State>, node: luau.AstStat, state: State) -> State,
read visit_ast_expression: (self: Base<State>,... | 7,995 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/examples/ds2-migrate-delete.luau | luau | .luau | --[[
This script will:
- Migrate the latest version of the DS2 data store to the migrated data store,
- Delete all of the entries in the DS2 data store except for the latest version.
This script migrates the latest version of the DS2 data store to the migrated data store,
and keeps the latest version in the ... | 836 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/examples/ds2-migrate.luau | luau | .luau | --[[
This script will:
- Migrate the latest version of the DS2 data store to the migrated data store,
- Delete all of the entries in the DS2 data store except for the latest version.
This script migrates the latest version of the DS2 data store to the migrated data store,
and keeps the latest version in the ... | 609 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/libs/frkcli/frkcli.luau | luau | .luau | --!nolint LocalShadow
local process = require("@lune/process")
local M = {}
type ArgKind = "POSITIONAL" | "FLAG" | "OPTION"
type ArgOptions = {
help: string?,
aliases: { string }?,
default: string?, -- if this is not nil, the arg will be optional
}
-- this is what is stored, we guarante non nullity when... | 4,269 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/libs/llc_tasks/tasks.luau | luau | .luau | --!nolint LocalShadow
local fs = require("@lune/fs")
local LuaEncode = require("./LuaEncode")
local tasks_client = require("./tasks_client")
local utils = require("./utils")
local m_tasks = {}
export type Error = tasks_client.TasksError
export type CreateTaskParams = tasks_client.CreateTaskParams
export type PollTas... | 1,008 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/libs/llc_tasks/utils.luau | luau | .luau | local m_utils = {}
function m_utils.notnil_or_default<T>(v: T?, d: T): T
if v == nil then
return d
end
return v
end
-- allows chaining member accesses forwarding nil if any intermediate step was nil
-- []/index to access members
-- () to get the value, optionally pass in a default
function m_utils... | 207 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/cli/core.luau | luau | .luau | --!strict
--[[
Core CLI functionality for parsing and handling command line arguments.
]]
-- Native Libraries
local process = require('@lune/process')
-- External Libraries
local frkcli = require('../../libs/frkcli/frkcli')
-- Local Libraries
local Constants = require('../shared/constants')
--[[
Generates ... | 974 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/commands/list.luau | luau | .luau | --!strict
--[[
Command for stopping a batch processing operation.
]]
-- Native Libraries
local process = require('@lune/process')
-- Local Libraries
local CLIO = require('../util/clio')
local ConfigValidators = require('../config/validators')
local Constants = require('../shared/constants')
local OpenCloudClient... | 744 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/config/validators.luau | luau | .luau | --!strict
--[[
Contains the validation handlers for each of the config values. Validation handlers
should validate the config value provided via these three means:
1. Command Line Arguments
2. Config File
3. Command Prompt
If the config value is valid, it should convert it to the correct ... | 6,154 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/main.luau | luau | .luau | --!strict
--[[
Main entry point for the batch processor CLI.
This module handles command line argument parsing, configuration loading,
and execution of batch processing commands.
]]
-- Native Libraries
local process = require('@lune/process')
-- Local Libraries
local CLI = require('./cli/core')
local CLI... | 569 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/shared/constants.luau | luau | .luau | --!strict
--[[
Constants used throughout the codebase.
]]
-- Local Libraries
local Types = require('./types')
-- Constants
local ActiveStage1TasksFile = "stage1_session_paths_active.output" -- The output file that contains the active stage 1 session paths
local ActiveStage2TasksFile = "stage2_session_paths_activ... | 2,630 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/fileio.luau | luau | .luau | --!strict
--[[
File I/O utility functions.
]]
-- Native Libraries
local fs = require('@lune/fs')
local serde = require('@lune/serde')
-- Local Libraries
local Constants = require('../shared/constants')
-- File IO
local FileIO = {}
--[[
Gets the directory from a filepath.
@param filepath string - The fu... | 1,418 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/formulas.luau | luau | .luau | --!strict
--[[
This file contains formulas for calculating the maximum and minimum memory stores storage and access that a batch process can use.
]]
-- Local Libraries
local Types = require('../shared/types')
-- Constants
local BUFFER_BYTES = 1024 -- Extra 1kb buffer
local BATCH_PROCESS_OVERHEAD_BYTES = 1125 -- ... | 1,338 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/guid-util.luau | luau | .luau | --!strict
--[[
Generates random GUIDs (UUID v4) using basic Lua functions.
]]
-- Constants for GUID generation
local HEX_CHARS = "0123456789abcdef"
local GUID_TEMPLATE = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
-- GuidUtil
local GuidUtil = {}
--[[
Generates a random hex character
@return string - A random... | 338 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/process-util.luau | luau | .luau | --!strict
--[[
Main utility functions for managing batch processes.
]]
-- Native Libraries
local fs = require('@lune/fs')
local serde = require('@lune/serde')
local task = require('@lune/task')
-- Local Libraries
local CLIO = require('../util/clio')
local Constants = require('../shared/constants')
local FileIO =... | 4,117 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/stage1-util.luau | luau | .luau | --!strict
--[[
This module handles the creation and management of stage 1 tasks for batch processing.
]]
-- Native Libraries
local process = require('@lune/process')
-- External Libraries
local llc_tasks = require('../../libs/llc_tasks/tasks')
-- Local Libraries
local CLIO = require('./clio')
local Constants = ... | 1,678 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/stage2-util.luau | luau | .luau | --!strict
--[[
This module handles the creation and management of stage 2 tasks for batch processing.
]]
-- Native Libraries
local process = require('@lune/process')
-- External Libraries
local llc_tasks = require('../../libs/llc_tasks/tasks')
-- Local Libraries
local CLIO = require('./clio')
local Constants = ... | 1,457 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/table-util.luau | luau | .luau | --!strict
--[[
Formats arguments into fixed-width blocks with separators.
]]
-- Local Libraries
local Constants = require('../shared/constants')
-- TableUtil
local TableUtil = {}
--[[
Formats a value to fit within a block of specified width.
If the value is too long, it will be truncated with "...".
... | 470 |
Roblox/data-stores-batch-processor-cli | Roblox-data-stores-batch-processor-cli-27c6164/src/util/time-util.luau | luau | .luau | --!strict
--[[
Time utility for handling Unix timestamps and datetime formatting.
]]
-- Native Libraries
local datetime = require("@lune/datetime")
-- TimeUtil
local TimeUtil = {}
--[[
Converts a Unix timestamp in milliseconds to a DateTime string.
@param timestamp number - Unix timestamp in millisecond... | 123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.