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 |
|---|---|---|---|---|---|
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/bins/stylua/init.luau | luau | .luau | local process = require("@lune/process")
local exitCode = require("@self/lune_packages/toolchainlib")("JohnnyMorganz/stylua", _G.PESDE_ROOT)
return process.exit(exitCode)
| 45 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/bins/zap/init.luau | luau | .luau | local process = require("@lune/process")
local exitCode = require("@self/lune_packages/toolchainlib")("red-blox/zap", _G.PESDE_ROOT)
return process.exit(exitCode)
| 43 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/compression.luau | luau | .luau | local process = require("@lune/process")
local dirs = require("../lune_packages/dirs")
local pathfs = require("../lune_packages/pathfs")
local unzip = require("../luau_packages/unzip")
local Result = require("../lune_packages/result")
local Option = require("../lune_packages/option")
type Result<T, E> = Result.Result... | 1,048 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/manifest.luau | luau | .luau | export type SPDXLicense =
"MIT"
| "Apache-2.0"
| "BSD-2-Clause"
| "BSD-3-Clause"
| "GPL-2.0"
| "GPL-3.0"
| "LGPL-2.1"
| "LGPL-3.0"
| "MPL-2.0"
| "ISC"
| "Unlicense"
| "WTFPL"
| "Zlib"
| "CC0-1.0"
| "CC-BY-4.0"
| "CC-BY-SA-4.0"
| "BSL-1.0"
| "EPL-2.0"
| "AGPL-3.0"
export type DependencySpecifier = ((... | 484 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/platform/descriptor.luau | luau | .luau | local process = require("@lune/process")
local os = require("./os")
local arch = require("./arch")
local toolchain = require("./toolchain")
local result = require("./result")
local detectFromExecutable = require("./detection/executable")
local Result = require("../../lune_packages/result")
local Option = require("../... | 466 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/platform/detection/executable.luau | luau | .luau | local process = require("@lune/process")
type Arch = process.Arch | "arm" | "x86"
export type ExecutableDescriptor = {
os: process.OS,
arch: { Arch },
}
local ENDIANNESS = {
function(x: number)
return x
end,
bit32.byteswap,
}
return function(binaryContents: buffer): ExecutableDescriptor?
-- Windows PE
do
... | 1,137 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/platform/detection/init.luau | luau | .luau | local executable = require("@self/executable")
export type ExecutableDescriptor = executable.ExecutableDescriptor
return {
detect = require("@self/pattern"),
detectFromExecutable = executable,
}
| 39 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/platform/detection/pattern.luau | luau | .luau | local String = require("../../utils/string")
local Option = require("../../../lune_packages/option")
type Option<T> = Option.Option<T>
local function charWordSep(char: string)
return char == " " or char == "-" or char == "_"
end
return function<T>(str: string, substrings: { [T]: { string } }, fullWords: { [T]: { st... | 246 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/platform/result.luau | luau | .luau | local Result = require("../../lune_packages/result")
type Result<T, E> = Result.Result<T, E>
export type PlatformError = "NoPatternDetected" | "NoExecutableDetected" | "UnknownExecutableField"
export type PlatformResult<T> = Result<T, PlatformError>
return "<PlatformResult>"
| 65 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/platform/toolchain.luau | luau | .luau | local Option = require("../../lune_packages/option")
type Option<T> = Option.Option<T>
local TOOLCHAINS: { Toolchain } = { "msvc", "gnu", "musl" }
export type Toolchain = "msvc" | "gnu" | "musl"
return {
detect = function(str: string): Option<Toolchain>
for _, toolchain: Toolchain in TOOLCHAINS do
if string.fin... | 130 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/utils/copy.luau | luau | .luau | local function copy<T>(tab: T): T
if typeof(tab) == "table" then
local copied = {}
for k, v in tab do
copied[k] = copy(v)
end
return copied :: any
end
return tab
end
return copy
| 64 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/utils/ext/option.luau | luau | .luau | --> Non-exhaustive set of extensions for the `Option<T>` type
local Option = require("../../../lune_packages/option")
local Result = require("../../../lune_packages/result")
local OptionExt = {}
function OptionExt.okOr<T, E>(self: Option.Option<T>, err: E): Result.Result<T, E>
return self:mapOrElse(function()
ret... | 108 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/utils/ext/result.luau | luau | .luau | --> Non-exhaustive set of extensions for the `Result<T, E>` type
local Option = require("../../../lune_packages/option")
local Result = require("../../../lune_packages/result")
local ResultExt = {}
function ResultExt.ok<T, E>(self: Result.Result<T, E>): Option.Option<T>
return self:mapOr(Option.None, function(val: ... | 99 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/utils/rev_table.luau | luau | .luau | return function(tab)
local len = #tab
for pos = 1, len // 2 do
tab[pos], tab[len - pos + 1] = tab[len - pos + 1], tab[pos]
end
end
| 50 |
pesde-pkg/tooling | pesde-pkg-tooling-2c980ab/toolchainlib/src/utils/sys.luau | luau | .luau | --> Non-exhaustive set of util functions for Linux systems
local process = require("@lune/process")
local ResultExt = require("./ext/result")
local fs = require("../../lune_packages/pathfs").fs
local Result = require("../../lune_packages/result")
local Option = require("../../lune_packages/option")
local sys = {}
s... | 392 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/.lune/fmt.luau | luau | .luau | --> Run stylua to check for formatting errors
local process = require("@lune/process")
local CommandBuilder = require("./lib/exec")
process.exit(
CommandBuilder.new("stylua")
:withArg(".")
:withArgs(process.args)
:withStdioStrategy("forward")
:exec().code
)
| 71 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/.lune/lib/channel.luau | luau | .luau | --- An MPSC synchronization primitive powered by Lua upvalues which retains only
--- one value at a time.
--- ## Usage
--- ```luau
--- local send, recv = watch((nil :: any) :: string)
--- task.delay(5, send, "hello, world!")
--- task.spawn(function()
--- local value = recv()
--- print("received value:", value)... | 264 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/.lune/lib/exec.luau | luau | .luau | --> lib: Builder pattern class to spawn child processes
local process = require("@lune/process")
local stdio = require("@lune/stdio")
local CommandBuilder = {}
export type CommandBuilder = typeof(setmetatable(
{} :: CommandBuilderFields,
{ __index = CommandBuilder }
))
type CommandBuilderFields = {
program: strin... | 669 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/.lune/lib/manifest.luau | luau | .luau | local fs = require("@lune/fs")
local serde = require("@lune/serde")
export type SPDXLicense =
"MIT"
| "Apache-2.0"
| "BSD-2-Clause"
| "BSD-3-Clause"
| "GPL-2.0"
| "GPL-3.0"
| "LGPL-2.1"
| "LGPL-3.0"
| "MPL-2.0"
| "ISC"
| "Unlicense"
| "WTFPL"
| "Zlib"
| "CC0-1.0"
| "CC-BY-4.0"
| "CC-BY-SA-4.0"
| "BSL-... | 561 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/.lune/tests/init.luau | luau | .luau | --> Run tests using frktest runner
local fs = require("@lune/fs")
local process = require("@lune/process")
local frktest = require("../luau_packages/frktest")
local reporter = require("@self/reporter")
-- HACK: Cast require to allow for dynamic paths in strict mode
-- A more proper solution would be to use luau.load... | 617 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/.lune/typecheck.luau | luau | .luau | --> Run luau-lsp analysis to check for type errors
local process = require("@lune/process")
local CommandBuilder = require("./lib/exec")
process.exit(
CommandBuilder.new("luau-lsp")
:withArg("analyze")
:withArgs({ "--settings", ".vscode/settings.json" })
:withArgs({ "--ignore", "'**/.pesde/**'" })
:withArgs... | 125 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/src/generators/argon/sync_config.luau | luau | .luau | local rojoSyncConfig = require("../rojo/sync_config")
export type TreeProperties = rojoSyncConfig.TreeProperties
export type TreeBase = rojoSyncConfig.TreeBase
export type TreeNormal = rojoSyncConfig.TreeNormal
export type TreeService = rojoSyncConfig.TreeService
export type DataModelTree = rojoSyncConfig.DataModelTre... | 228 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/src/generators/rojo/sync_config.luau | luau | .luau | local fs = require("@lune/fs")
local process = require("@lune/process")
local serde = require("@lune/serde")
export type TreeProperties = {
Name: never?,
Parent: never?,
}
export type TreeBase = {
["$className"]: string?,
["$ignoreUnknownInstances"]: boolean?,
["$path"]: string | { optional: string }?,
["$prope... | 843 |
pesde-pkg/scripts | pesde-pkg-scripts-ee149e2/src/init.luau | luau | .luau | return {
generators = {
rojo = {
sourcemap = require("@self/generators/rojo/sourcemap"),
syncConfig = require("@self/generators/rojo/sync_config"),
},
argon = {
sourcemap = require("@self/generators/argon/sourcemap"),
syncConfig = require("@self/generators/argon/sync_config"),
},
},
}
| 101 |
biggaboy212/Marionette | biggaboy212-Marionette-998840f/tests/breakpointClosures.luau | luau | .luau | local function run()
print("start")
debugger.halt()
print("next")
local function nested()
debugger.halt()
print("done")
end
nested()
end
run() | 44 |
biggaboy212/Marionette | biggaboy212-Marionette-998840f/tests/breakpoints.luau | luau | .luau | local num = 10
debugger.watch("num", function(set: any?) -- add the var "num" to watch stack as "num"
if set ~= nil then
num = set
end
return num
end)
--[[ debugger.watchBatch{ -- add a set of vars to the watch stack
num = function(set: any?)
num = set or num
return num
end,
} ]]
debugger.halt() -- brea... | 135 |
biggaboy212/Marionette | biggaboy212-Marionette-998840f/tests/infiniteBreakPoints.luau | luau | .luau | local function run()
debugger.halt()
run()
end
run() | 16 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/Kebab.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to kebab case ("kebab-case")
local function toKebabCase(str: string): string
return Utils.transform(str, Utils.lowercase, '-')
end
return {
toKebabCase = toKebabCase,
}
| 62 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/LowerCamel.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to lower camel case ("lowerCamelCase")
local function toLowerCamelCase(str: string): string
local first = true
return Utils.transform(str, function(chars, start, end_, formatter)
if first then
first = false
Utils.lowercase(ch... | 117 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/ShoutyKebab.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to shouty kebab case ("SHOUTY-KEBAB-CASE")
local function toShoutyKebabCase(str: string): string
return Utils.transform(str, Utils.uppercase, '-')
end
return {
toShoutyKebabCase = toShoutyKebabCase,
}
| 78 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/ShoutySnake.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to shouty snake case ("SHOUTY_SNAKE_CASE")
local function toShoutySnakeCase(str: string): string
return Utils.transform(str, Utils.uppercase, '_')
end
return {
toShoutySnakeCase = toShoutySnakeCase,
}
| 71 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/Snake.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to snake case ("snake_case_example")
local function toSnakeCase(str: string): string
return Utils.transform(str, Utils.lowercase, '_')
end
return {
toSnakeCase = toSnakeCase,
}
| 56 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/Title.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to title case ("Title Case")
local function toTitleCase(str: string): string
return Utils.transform(str, Utils.capitalize, ' ')
end
return {
toTitleCase = toTitleCase,
}
| 54 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/Train.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to train case ("Train-Case")
local function toTrainCase(str: string): string
return Utils.transform(str, Utils.capitalize, '-')
end
return {
toTrainCase = toTrainCase,
}
| 54 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/UpperCamel.luau | luau | .luau | local Utils = require('./utils')
-- converts a string to upper camel case ("UpperCamelCase")
local function toUpperCamelCase(str: string): string
return Utils.transform(str, Utils.capitalize, '')
end
return {
toUpperCamelCase = toUpperCamelCase,
}
| 62 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/Heck.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local Heck = require('..')
local expect = jestGlobals.expect
local it = jestGlobals.it
local describe = jestGlobals.describe
local testString = 'camelCase'
describe('toSnakeCase', function()
it('should convert to snake_case', function()
expect(H... | 427 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/Kebab.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local Kebab = require('../Kebab')
local expect = jestGlobals.expect
local it = jestGlobals.it
local function t(testName: string, input: string, expected: string)
it(`'{input}' converts to '{expected}' ({testName})`, function()
expect(Kebab.toKeba... | 449 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/ShoutyKebab.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local ShoutyKebab = require('../ShoutyKebab')
local expect = jestGlobals.expect
local it = jestGlobals.it
local function t(testName: string, input: string, expected: string)
it(`'{input}' converts to '{expected}' ({testName})`, function()
expect(... | 383 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/ShoutySnake.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local ShoutySnake = require('../ShoutySnake')
local expect = jestGlobals.expect
local it = jestGlobals.it
local function t(testName: string, input: string, expected: string)
it(`'{input}' converts to '{expected}' ({testName})`, function()
expect(... | 328 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/Snake.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local Snake = require('../Snake')
local expect = jestGlobals.expect
local it = jestGlobals.it
local function t(testName: string, input: string, expected: string)
it(`'{input}' converts to '{expected}' ({testName})`, function()
expect(Snake.toSnak... | 543 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/Title.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local Title = require('../Title')
local expect = jestGlobals.expect
local it = jestGlobals.it
local function t(testName: string, input: string, expected: string)
it(`'{input}' converts to '{expected}' ({testName})`, function()
expect(Title.toTitl... | 298 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/Train.test.luau | luau | .luau | local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local Train = require('../Train')
local expect = jestGlobals.expect
local it = jestGlobals.it
local function t(testName: string, input: string, expected: string)
it(`'{input}' converts to '{expected}' ({testName})`, function()
expect(Train.toTrai... | 594 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/__tests__/edge-cases.test.luau | luau | .luau | local Heck = require('../init')
local jestGlobals = require('@pkg/@jsdotlua/jest-globals')
local expect = jestGlobals.expect
local it = jestGlobals.it
local describe = jestGlobals.describe
describe('Edge Cases and Unicode Handling', function()
describe('Empty and Nil Inputs', function()
it('should handle ... | 943 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/init.luau | luau | .luau | local Kebab = require('./Kebab')
local LowerCamel = require('./LowerCamel')
local ShoutyKebab = require('./ShoutyKebab')
local ShoutySnake = require('./ShoutySnake')
local Snake = require('./Snake')
local Title = require('./Title')
local Train = require('./Train')
local UpperCamel = require('./UpperCamel')
return {
... | 224 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/rust-utils/splitString.luau | luau | .luau | local function splitString(str: string, condition: (string) -> boolean): { string }
local result = {}
local currentWord = 0
for position, c in utf8.codes(str) do
local character = utf8.char(c)
if condition(character) then
table.insert(result, string.sub(str, currentWord + 1, po... | 155 |
seaofvoices/heck-luau | seaofvoices-heck-luau-9e21169/src/utils.luau | luau | .luau | local character = require('@pkg/luau-character')
local splitString = require('./rust-utils/splitString')
local isAlphaNumeric = character.isAlphaNumeric
local isLowercase = character.isLowercase
local isUppercase = character.isUppercase
local toLowercase = character.toLowercase
local toUppercase = character.toUpperca... | 1,094 |
EgoMoose/ordered-dictionary-luau | EgoMoose-ordered-dictionary-luau-2aa02e8/lune/jest-test.luau | luau | .luau | local fs = require("@lune/fs")
local serde = require("@lune/serde")
local roblox = require("@lune/roblox")
local run = require("@utils/run")
local function enableFFlagEnableLoadModule()
local hadFolder = true
local pathToStudio = roblox.studioApplicationPath():gsub("\\", "/")
local clientSettingsFolderPath = pathTo... | 370 |
EgoMoose/ordered-dictionary-luau | EgoMoose-ordered-dictionary-luau-2aa02e8/lune/wally-install.luau | luau | .luau | local fs = require("@lune/fs")
local run = require("@utils/run")
run("wally", { "install" })
for _, folderName in { "Packages", "DevPackages", "ServerPackages" } do
if not fs.isDir(folderName) then
fs.writeDir(folderName)
end
end
run("rojo", { "sourcemap", "develop.project.json", "-o", "sourcemap.json" })
for _,... | 154 |
EgoMoose/ordered-dictionary-luau | EgoMoose-ordered-dictionary-luau-2aa02e8/src/init.luau | luau | .luau | --[=[
@class OrderedDictionary
A generic dictionary that preserves the order in which keys are inserted.
Entries are stored in a doubly linked list, so insertion, replacement, and
removal are all O(1). Positional lookups (`keyAtIndex`/`indexAtKey`) are
served from an index cache that is rebuilt lazily on the fir... | 2,908 |
EgoMoose/ordered-dictionary-luau | EgoMoose-ordered-dictionary-luau-2aa02e8/tests/TestRunner/ServerRunner/init.server.luau | luau | .luau | require(script.Parent)
| 4 |
EgoMoose/ordered-dictionary-luau | EgoMoose-ordered-dictionary-luau-2aa02e8/tests/TestRunner/init.luau | luau | .luau | local Tests = game.ReplicatedStorage.DevPackages.Tests
local runCLI = require(game.ReplicatedStorage.DevPackages.Jest).runCLI
local processServiceExists, ProcessService = pcall(function()
return game:GetService("ProcessService")
end)
local status, result = runCLI(Tests, {
ci = false,
passWithNoTests = true,
}, { T... | 163 |
malice-nz/Splice | malice-nz-Splice-2be7467/Lowerer.luau | luau | .luau | local Opcodes = require("./Opcodes")
local Lowerer = {}
local LOP = Opcodes
local EncodeABC = Opcodes.EncodeABC
local EncodeAD = Opcodes.EncodeAD
local EncodeE = Opcodes.EncodeE
local function CreateFunctionState(Parent: any?, NumParams: number, IsVararg: boolean): any
local FS = {
Parent = Parent,
FreeReg = 0,... | 13,592 |
malice-nz/Splice | malice-nz-Splice-2be7467/Opcodes.luau | luau | .luau | local Opcodes = {}
Opcodes.LOP_NOP = 0
Opcodes.LOP_BREAK = 1
Opcodes.LOP_LOADNIL = 2
Opcodes.LOP_LOADB = 3
Opcodes.LOP_LOADN = 4
Opcodes.LOP_LOADK = 5
Opcodes.LOP_MOVE = 6
Opcodes.LOP_GETGLOBAL = 7
Opcodes.LOP_SETGLOBAL = 8
Opcodes.LOP_GETUPVAL = 9
Opcodes.LOP_SETUPVAL = 10
Opcodes.LOP_CLOSEUPVALS = 11
Opcodes.LOP_GET... | 2,067 |
malice-nz/Splice | malice-nz-Splice-2be7467/Parser.luau | luau | .luau | local Parser = {}
local UNARY_PRIORITY = 7
local BinaryPriority = {
["+"] = { 5, 5 },
["-"] = { 5, 5 },
["*"] = { 6, 6 },
["/"] = { 6, 6 },
["//"] = { 6, 6 },
["%"] = { 6, 6 },
["^"] = { 9, 8 },
[".."] = { 4, 3 },
["=="] = { 3, 3 },
["~="] = { 3, 3 },
["<"] = { 3, 3 },
["<="] = { 3, 3 },
[">"] = { 3, 3 }... | 5,155 |
malice-nz/Splice | malice-nz-Splice-2be7467/Sandbox.luau | luau | .luau | local Sandbox = {}
local _moduleScript: any = script
local _game: any = nil
do
local current: any = _moduleScript
while current and current.Parent do
current = current.Parent
end
_game = current
end
local RobloxGlobalValues: { [string]: any } = {}
RobloxGlobalValues.game = _game
if _game then
pcall(function()... | 2,097 |
malice-nz/Splice | malice-nz-Splice-2be7467/Serialiser.luau | luau | .luau | local Serialiser = {}
local LUAU_BYTECODE_VERSION = 6
local LBC_CONSTANT_NIL = 0
local LBC_CONSTANT_BOOLEAN = 1
local LBC_CONSTANT_NUMBER = 2
local LBC_CONSTANT_STRING = 3
local LBC_CONSTANT_IMPORT = 4
local LBC_CONSTANT_TABLE = 5
local LBC_CONSTANT_CLOSURE = 6
local LBC_CONSTANT_VECTOR = 7
local function WriteVarIn... | 3,248 |
malice-nz/Splice | malice-nz-Splice-2be7467/VM.luau | luau | .luau | local Opcodes = require("./Opcodes")
local Sandbox = require("./Sandbox")
local VM = {}
local DecodeOp = Opcodes.DecodeOp
local DecodeA = Opcodes.DecodeA
local DecodeB = Opcodes.DecodeB
local DecodeC = Opcodes.DecodeC
local DecodeD = Opcodes.DecodeD
local DecodeE = Opcodes.DecodeE
local LOP = Opcodes
local function ... | 6,358 |
malice-nz/Splice | malice-nz-Splice-2be7467/init.luau | luau | .luau | local Lexer = require(script.Lexer)
local Parser = require(script.Parser)
local Lowerer = require(script.Lowerer)
local VM = require(script.VM)
local Serialiser = require(script.Serialiser)
local Sandbox = require(script.Sandbox)
local Splice = {}
function Splice.Compile(Source: string): any
local Tokens = Lexer.Tok... | 231 |
Scythe-Technology/glfw-luau | Scythe-Technology-glfw-luau-8db9978/src/c.luau | luau | .luau | --!strict
local fs = zune.fs;
local ffi = zune.ffi;
local process = zune.process;
local GLFW_TRUE = 1;
local GLFW_FALSE = 0;
local LIBRARY_PATH = `./libs/glfw/build/src/{ffi.prefix}glfw.{ffi.suffix}`;
if (process.os == "windows") then
LIBRARY_PATH = `./libs/glfw/build/src/{
if (fs.stat(`./libs/glfw/build/... | 7,691 |
Scythe-Technology/glfw-luau | Scythe-Technology-glfw-luau-8db9978/src/gl.luau | luau | .luau | --!strict
local constants = {
DEPTH_BUFFER_BIT = 0x00000100,
STENCIL_BUFFER_BIT = 0x00000400,
COLOR_BUFFER_BIT = 0x00004000,
FALSE = 0,
TRUE = 1,
POINTS = 0x0000,
LINES = 0x0001,
LINE_LOOP = 0x0002,
LINE_STRIP = 0x0003,
TRIANGLES = 0x0004,
TRIANGLE_STRIP = 0x0005,
TRIANG... | 44,142 |
Scythe-Technology/glfw-luau | Scythe-Technology-glfw-luau-8db9978/src/init.luau | luau | .luau | --!strict
local ffi = zune.ffi
local c = require("@self/c");
local glfw = c.glfw;
local window = require("@self/window");
local module = {};
module.gl = require("@self/gl");
module.D = c.defined;
function module.init(): ()
if (glfw.glfwInit() == glfw.GLFW_FALSE) then
module.emitError();
end
end
... | 521 |
Scythe-Technology/glfw-luau | Scythe-Technology-glfw-luau-8db9978/src/window.luau | luau | .luau | --!strict
local ffi = zune.ffi;
local c = require("./c");
local glfw = c.glfw;
local window = {};
window.__index = window;
function window.init(ptr: FFIPointer)
return setmetatable({
handle = ptr::FFIPointer?,
callbacks = {}::{[string]: FFIPointer?},
}, window);
end
--[=[
Returns the ti... | 2,734 |
dphfox/scoped | dphfox-scoped-bde8b0a/example_usage.luau | luau | .luau | --!strict
local scoped = require("./scoped.luau")
local scoped, doCleanup = scoped.scoped, scoped.doCleanup
local constructors = {}
function constructors.Person(
cleanup: scoped.CleanupTable,
name: string
)
local self = {
name = name
}
table.insert(cleanup, function()
print(name, "has left the building!")
... | 138 |
luau-ecs/oxgz | luau-ecs-oxgz-93c0114/lune/styling.luau | luau | .luau | local process = require("@lune/process")
local result = process.exec("stylua", { "lune", "src", "test", "--check" }, {
stdio = "forward",
})
process.exit(result.code)
| 46 |
luau-ecs/oxgz | luau-ecs-oxgz-93c0114/lune/test.luau | luau | .luau | local process = require("@lune/process")
print("hi")
process.exit(0)
| 18 |
bytexenon/luau-rng-cracker | bytexenon-luau-rng-cracker-56c8911/main.luau | luau | .luau | --[[
Reconstruct the initial state of Luau's global PCG32 generator.
In luau/VM/src/lmathlib.cpp, luaopen_math seeds global_State::rngstate as:
uint64_t seed = uintptr_t(L);
seed ^= time(NULL);
seed ^= clock();
pcg32_seed(&L->global->rngstate, seed);
From Luau, the only term that is not directly obser... | 1,739 |
jiwonz/pesde-multitarget | jiwonz-pesde-multitarget-40488af/scripts/example.luau | luau | .luau | local lib = require("../src/lib")
lib.build(
"pesde.toml",
{
luau = true,
lune = true,
roblox = true,
},
"dist",
{
"src",
},
"LUA_ENV",
"pkg"
)
| 64 |
jiwonz/pesde-multitarget | jiwonz-pesde-multitarget-40488af/src/bin.luau | luau | .luau | local argparse = require("../lune_packages/argparse")
local multitarget = require("./lib")
local pathfs = require("../lune_packages/pathfs")
local fs = pathfs.fs
local stdio = require("@lune/stdio")
local serde = require("@lune/serde")
local process = require("@lune/process")
local chalk = require("../luau_packages/cha... | 2,791 |
jiwonz/pesde-multitarget | jiwonz-pesde-multitarget-40488af/src/lib.luau | luau | .luau | local stdio = require("@lune/stdio")
local serde = require("@lune/serde")
local pathfs = require("../lune_packages/pathfs")
local fs = pathfs.fs
local gt = require("../lune_packages/greentea")
local glob = require("../lune_packages/glob")
local process = require("@lune/process")
local darklua = require("../lune_package... | 3,594 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/examples/normalize.luau | luau | .luau | local pathfs = require("../src/lib")
print(pathfs.normalize("../src/./lib/../lib/normalizePath.luau"))
print(pathfs.canonicalize("./.vscode"))
| 37 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/examples/observe.luau | luau | .luau | local pathfs = require("../src/lib")
local task = require("@lune/task")
local disconnectObserver = pathfs.observeDescendantEntry(".playground/test", function(entry)
print("Hello bro", entry)
return function()
print("Oh no I didn't")
end
end)
task.wait(5)
disconnectObserver()
| 67 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/examples/serialize.luau | luau | .luau | local pathfs = require("../src/lib")
-- Example data to serialize
local config = {
name = "Example Application",
version = "1.0.0",
database = {
host = "localhost",
port = 5432,
name = "myapp"
},
features = {
"authentication",
"logging",
"caching"
},
settings = {
debug = true,
maxConnections = 1... | 540 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/examples/utilities.luau | luau | .luau | local pathfs = require("../src/lib")
local file = pathfs.FilePath.new("hi"):withFileWritten("hello")
file:writeFile("hallo")
file:removeFile()
local dir = pathfs.DirectoryPath.new("hi"):withDirWritten()
dir:removeDir()
pathfs.writeFileAll(pathfs.Path.new("a/b/c"):join(file.path), "hello2")
| 80 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/examples/watch.luau | luau | .luau | local pathfs = require("../src/lib")
pathfs.watchDirectories({
".playground/test",
".playground/test2",
}, function()
print("yolo")
end)
| 37 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/lune/test.luau | luau | .luau | local function loadTests()
require("@tests/path")()
require("@tests/fs")()
require("@tests/utilities")()
end
local function runTests()
local frktest = require("../luau_packages/frktest")
frktest.reporters.console_reporter.init()
local success = frktest.run()
if not success then
require("@lune/process").exit(... | 89 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/src/DirectoryPath.luau | luau | .luau | local luauPath = require("../luau_packages/luau_path")
local Path = luauPath.Path
local fs = require("./fs")
local types = require("./types")
local PathType = types.PathType
local AsPathType = types.AsPathType
local optionalBooleanType = types.optionalBooleanType
local arrayOfStringType = types.arrayOfStringType
local... | 1,408 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/src/FilePath.luau | luau | .luau | local luauPath = require("../luau_packages/luau_path")
local Path = luauPath.Path
local fs = require("./fs")
local types = require("./types")
local PathType = types.PathType
local AsPathType = types.AsPathType
local ContentsType = types.ContentsType
local optionalBooleanType = types.optionalBooleanType
local stringTyp... | 1,273 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/src/fs.luau | luau | .luau | local luneFileSystem = require("@lune/fs")
local gt = require("../luau_packages/greentea")
local vfs = require("./vfs")
local asPathToString = vfs.asPathToString
local types = require("./types")
local AsPathType = types.AsPathType
local booleanType = types.booleanType
local stringType = types.stringType
local Contents... | 1,755 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/src/normalizePath.luau | luau | .luau | local types = require("./types")
local luauPath = require("../luau_packages/luau_path")
local Path = luauPath.Path
type Component = types.Component
type Components = types.Components
type AsPath = luauPath.AsPath
type Path = luauPath.Path
export type PeekableComponents = typeof(setmetatable(
{} :: {
iter: Componen... | 628 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/src/vfs.luau | luau | .luau | local types = require("./types")
local AsPathType = types.AsPathType
local luauPath = require("../luau_packages/luau_path")
local Path = luauPath.Path
local process = require("@lune/process")
local normalizePath = require("./normalizePath")
type Path = luauPath.Path
type AsPath = luauPath.AsPath
--[=[
@class vfs
@p... | 364 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/tests/fs.luau | luau | .luau | local frktest = require("../luau_packages/frktest")
local test = frktest.test
local check = frktest.assert.check
local pathfs = require("../src/lib")
local fs = pathfs.fs
return function()
local test1 = "tests/test1.txt"
local test2 = "tests/test2.txt"
local test3 = "tests/test3.txt"
local test_content = "Hello, w... | 1,014 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/tests/path.luau | luau | .luau | local frktest = require("../luau_packages/frktest")
local test = frktest.test
local check = frktest.assert.check
local pathfs = require("../src/lib")
return function()
test.suite("joining paths", function()
local expectedResultPath = pathfs.Path.from("tests/test1.txt")
test.case("path and string", function()
... | 218 |
jiwonz/lune-pathfs | jiwonz-lune-pathfs-1e42484/tests/utilities.luau | luau | .luau | local frktest = require("../luau_packages/frktest")
local test = frktest.test
local check = frktest.assert.check
local pathfs = require("../src/lib")
return function()
test.suite("pathfs.script", function()
test.case("should handle script path gracefully", function()
-- Test that script() function exists and is ... | 2,856 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/benchmark/benchmark.lua | luau | .lua | -- ROBLOX no upstream
--[[
ROBLOX note:
custom implementation for BenchmarkJS
only supporting necessary features
]]
local rootWorkspace = script.Parent.Parent
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Object = LuauPolyfill.Object
type Function = (...any) -> ...any
type Array<T> = Luau... | 1,337 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/benchmark/calculateStats.lua | luau | .lua | -- ROBLOX no upstream
local rootWorkspace = script.Parent.Parent
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Array = LuauPolyfill.Array
local Boolean = LuauPolyfill.Boolean
type Array<T> = { [number]: T }
export type Stats = {
min: number,
max: number,
mean: number,
variance: number,
sd: numbe... | 888 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/bin/benchmark.lua | luau | .lua | local Root = script.Parent.ApolloClientBenchmarkModel
local ProcessService = game:GetService("ProcessService")
local Packages = Root.Packages
local benchmark = require(Packages.ApolloClientBenchmarks)
local ok, result = pcall(benchmark)
if not ok then
warn(result)
ProcessService:ExitAsync(1)
else
ProcessService:E... | 83 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/bin/spec.lua | luau | .lua | local Root = game:GetService("ReplicatedStorage")
local Packages = Root.Packages
local runCLI = require(Packages.Dev.Jest).runCLI
local processServiceExists, ProcessService = pcall(function()
return game:GetService("ProcessService")
end)
local status, result = runCLI(Root, {
verbose = _G.verbose == "true",
ci = ... | 189 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/jest.config.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
return {
displayName = "ApolloClientLua",
testMatch = { "**/*.spec" },
setupFiles = { script.Parent.config.jest.setup },
}
| 70 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/jsutils/equal.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local srcWorkspace = script.Parent.Parent
local Packages = srcWorkspace.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
local Array, Obj... | 463 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/jsutils/typedDocumentNode.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local srcWorkspace = script.Parent.Parent
local rootWorkspace = srcWorkspace.Parent
local graphQLModule = require(rootWorkspace.GraphQL)
type Docu... | 247 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/Object.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local rootWorkspace = script.Parent.Parent.Parent
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
-- ROBLOX TODO: include this in LuauPol... | 156 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/encodeURIComponent.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local HttpService = game:GetService("HttpService")
-- ROBLOX TODO: include in LuauPolyfill
local function encodeURIComponent(value: string): strin... | 204 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/hasOwnProperty.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local function hasOwnProperty(obj: { [any]: any }, prop: string | number): boolean
return obj[prop] ~= nil
end
return hasOwnProperty
| 72 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/init.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local rootWorkspace = script.Parent.Parent
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Object = LuauPolyfill.Object
local makeI... | 98 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/makeIntervalImpl.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX TODO: move this to LuauPolyfill
local Status = newproxy(false)
type Status = typeof(Status)
type TaskStatus = number
type Task = { [Stat... | 315 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/objectKeysForEach.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
return function<T, U>(obj: { [T]: U }, callback: (T) -> ())
for key, _ in obj do
callback(key)
end
end
| 76 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/sortedEncode.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
local rootWorkspace = script.Parent.Parent.Parent
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Array = LuauPolyfill.Array
local ... | 195 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/luaUtils/stringIndexOf.lua | luau | .lua | --[[
* Copyright (c) Roblox Corporation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX comment: no upstream
-- ROBLOX TODO: replace when added to LuauPolyfill
local exports = {}
local function stringIndexOf(s: string, subst... | 124 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/optimism/anyEntryTypes.lua | luau | .lua | --[[
* Copyright (c) 2016 Ben Newman
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX no upstream, extracted from optimism/entry.ts to work around circular types/deps
local srcWorkspace = script.Parent.Parent
local rootWorksp... | 585 |
Roblox/apollo-client-lua | Roblox-apollo-client-lua-704dbbe/src/optimism/depTypes.lua | luau | .lua | --[[
* Copyright (c) 2016 Ben Newman
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
]]
-- ROBLOX no upstream
local srcWorkspace = script.Parent.Parent
local rootWorkspace = srcWorkspace.Parent
local LuauPolyfill = require(rootWorkspace.L... | 226 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.