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
vantoanvh/LuauPorts
vantoanvh-LuauPorts-15cd630/Conversion/Base94.luau
luau
.luau
--!optimize 2 --!native --!strict local DIRECT_LOOKUP = {} local BIT_MASK = {} local ENCODE_MAP = {} local DECODE_MAP = {} local j = 0 for i = 32, 127 do if i ~= 34 and i ~= 92 then ENCODE_MAP[j] = i DECODE_MAP[i] = j j += 1 end end for entry = 0, 8835 do DIRECT_LOOKUP[entry] = bit32.bor( bit32.lshift(EN...
836
vantoanvh/LuauPorts
vantoanvh-LuauPorts-15cd630/Decoder/DecodeGIF.luau
luau
.luau
--!optimize 2 --!native --!strict --[[ GIFDecoder.luau Public API: - Module returns DecodeGif(GifData: buffer). - DecodeGif returns a mutable animation state: { Animated = boolean, Size = Vector2.new(Width, Height), RGBA8 = CurrentCanvas, Frame = CurrentCanvas, AdvanceFrame = AdvanceFrame, Res...
8,670
vantoanvh/LuauPorts
vantoanvh-LuauPorts-15cd630/Decoder/DecodeJPEG.luau
luau
.luau
--!optimize 2 --!native --!strict --[[ JPEGDecoder.luau Public API: - Module returns DecodeJpeg(JpegData: buffer). - DecodeJpeg returns { Size = Vector2.new(Width, Height), RGBA8 = OutputBuffer }. - OutputBuffer is packed row-major RGBA8 using buffer.writeu32-compatible byte order. Supported JPEG image coding:...
27,109
vantoanvh/LuauPorts
vantoanvh-LuauPorts-15cd630/Decoder/DecodePNG.luau
luau
.luau
--!optimize 2 --!native --!strict --[[ PNGDecoder.luau Public API: - Module returns DecodePng(PngData: buffer). - DecodePng always returns: { Animated: boolean, Size: Vector2, RGBA8: buffer, Frame: buffer, AdvanceFrame: () -> (), Reset: () -> (), Finished: boolean, Delay: number, } - ...
31,135
TheNexusAvenger/Nexus-Instance
TheNexusAvenger-Nexus-Instance-b380c16/src/Event/TypedEvent.luau
luau
.luau
--Typed event with support for table-based payloads. --!strict local HttpService = game:GetService("HttpService") local RunService = game:GetService("RunService") local TypedEventConnection = require(script.Parent:WaitForChild("TypedEventConnection")) local TypedEvent = {} TypedEvent.LastArguments = {} :: {[string]:...
986
TheNexusAvenger/Nexus-Instance
TheNexusAvenger-Nexus-Instance-b380c16/src/Event/TypedEventConnection.luau
luau
.luau
--Connection for a typed event. --!strict local TypedEventConnection = {} TypedEventConnection.__index = TypedEventConnection export type TypedEventStub<T...> = { Disconnected: (TypedEventStub<T...>, TypedEventConnection<T...>) -> (), [any]: any, } export type TypedEventConnection<T...> = { Connected: bo...
342
TheNexusAvenger/Nexus-Instance
TheNexusAvenger-Nexus-Instance-b380c16/src/init.luau
luau
.luau
--Main module for Nexus Instance. --!strict local METATABLE_METHODS = { "__call", "__concat", "__unm", "__add", "__sub", "__mul", "__div", "__idiv", "__mod", "__pow", "__tostring", "__eq", "__lt", "__le", "__gc", "__len", "__iter", } local TypedEvent...
1,773
tijnepema/simpoll
tijnepema-simpoll-18a99df/lib-luau/.lune/build.luau
luau
.luau
local fs = require("@lune/fs") local logger = require("./lib/logger").new(4) local executeCommand = require("./lib/executeCommand") local didError = false local function execCommandWrapper(...) local data = executeCommand(...) if data.stderr ~= "" then didError = true end return data end local function recu...
409
tijnepema/simpoll
tijnepema-simpoll-18a99df/lib-luau/.lune/dev.luau
luau
.luau
local fs = require("@lune/fs") local task = require("@lune/task") local logger = require("./lib/logger").new(4) local fileWatcher = require("./lib/fileWatcher") local executeCommand = require("./lib/executeCommand") local function recursiveCopy(src, dest) local files = fs.readDir(src) for _, file in files do loc...
510
tijnepema/simpoll
tijnepema-simpoll-18a99df/lib-luau/.lune/install-packages.luau
luau
.luau
local fs = require("@lune/fs") local logger = require("./lib/logger").new(4) local executeCommand = require("./lib/executeCommand") if fs.isDir("packages") then fs.removeDir("packages") end local status = executeCommand("wally", { "install", }, { stdio = "inherit" }, true) if not status.ok then logger...
318
tijnepema/simpoll
tijnepema-simpoll-18a99df/lib-luau/.lune/lib/executeCommand.luau
luau
.luau
local process = require("@lune/process") local logger = require("./logger").new(4) return function(command, args, options, ignoreErrors) local data = process.spawn(command, args, options or { stdio = "default", }) if data.stderr ~= "" and not ignoreErrors then logger:error(`Error occurred when running \"{comm...
92
tijnepema/simpoll
tijnepema-simpoll-18a99df/lib-luau/.lune/lib/fileWatcher.luau
luau
.luau
local fs = require("@lune/fs") local date = require("@lune/datetime") local task = require("@lune/task") type fileMap = { path: string, children: { fileMap | string }, } return function(directory: string, callback: (files: { string }) -> any, onDelete: (files: { string }) -> any) local lastModified: number = nil :...
609
tijnepema/simpoll
tijnepema-simpoll-18a99df/lib-luau/.lune/lib/logger.luau
luau
.luau
local logger = {} local terminal = require("./terminal") local chalk = require("./chalk") local dateTime = require("@lune/datetime") local function padToTwo(number: number): string return number < 10 and `0{number}` or tostring(number) end local function generateTimestamp(): string local time = dateTime.now():toLo...
494
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/scripts/build.luau
luau
.luau
-- scripts/build.luau local process = require("@lune/process") local multitarget = require("../lune_packages/multitarget") local result = multitarget.build( "pesde.toml", { luau = true; lune = true; roblox = true; }, "dist", { "src"; }, "LUA_ENV" ) if resul...
169
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/assemble.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Mdules ]#-- local super_table = require("@luau_pkg/super_table") local hangul = require("../internal/hangul") local disassemble = require("../core/disassemble") --#[ Variables ]#-- -- --#[ Functions ]#-- -- --#[ Main ]#-- function module.assemble( fragments: { str...
201
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/canBe.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Modules ]#-- local constants = require("../internal/constants") --#[ Variables ]#-- local canBeChoseongCache: { [string]: boolean } = {} local canBeJungseongCache: { [string]: boolean } = {} local canBeJongseongCache: { [string]: boolean } = {} --#[ Functions ]#-- -- ...
382
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/combine.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Mdules ]#-- local constants = require("../internal/constants") --#[ Variables ]#-- -- --#[ Functions ]#-- -- --#[ Main ]#-- function module.combineCharacter( choseong: string, jungseong: string, jongseong: string? ): string local choseongIndex = table....
470
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/disassemble.luau
luau
.luau
--#[ Types ]#-- export type DisassembledCompleteCharacter = { choseong: string; jungseong: string; jongseong: string; } --#[ Head Variables ]#-- local module = {} --#[ Modules ]#-- local super_table = require("@luau_pkg/super_table") local constants = require("../internal/constants") --#[ Variables ]#-- ...
859
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/getChoseong.luau
luau
.luau
--[[ Luau에는 normalize관련 기능이 없기 때문에 다른 방식으로 초성을 구한다. ]] --#[ Head Variables ]#-- local module = {} --#[ Mdules ]#-- local super_table = require("@luau_pkg/super_table") local disassemble = require("../core/disassemble") --#[ Variables ]#-- -- --#[ Functions ]#-- -- --#[ Main ]#-- function module.getChoseong( ...
175
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/hasBatchim.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Modules ]#-- local constants = require("../internal/constants") --#[ Variables ]#-- -- --#[ Functions ]#-- -- --#[ Main ]#-- function module.hasBatchim( string: string ): boolean if utf8.len(string) == 0 then return false end local charCode = ...
534
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/init.luau
luau
.luau
local assemble = require("@self/assemble") local canBe = require("@self/canBe") local combine = require("@self/combine") local disassemble = require("@self/disassemble") local getChoseong = require("@self/getChoseong") local hasBatchim = require("@self/hasBatchim") local josa = require("@self/josa") local removeLastCha...
151
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/josa.luau
luau
.luau
--#[ Types ]#-- type JosaOption = "이/가" | "을/를" | "은/는" | "으로/로" | "와/과" | "이나/나" | "이란/란" | "아/야" | "이랑/랑" | "이에요/예요" | "으로서/로서" | "으로써/로써" | "으로부터/로부터" | "이라/라" --#[ Head Variables ]#-- local module = {} --#[ Modules ]#-- local disassemble = require("../core/disas...
645
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/core/removeLastCharacter.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Mdules ]#-- local canBe = require("../core/canBe") local combine = require("../core/combine") local disassemble = require("../core/disassemble") --#[ Variables ]#-- -- --#[ Functions ]#-- local function excludeLastElement<V>( array: { V } ): ({ V }, V) local la...
456
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/init.luau
luau
.luau
local core = require("@self/core") local number = require("@self/number") return { core = core; number = number; }
30
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/internal/constants.luau
luau
.luau
--#[ Modules ]#-- local super_table = require("@luau_pkg/super_table") --#[ Variables ]#-- local COMPLETE_HANGUL_START_CHARCODE = utf8.codepoint("가") local COMPLETE_HANGUL_END_CHARCODE = utf8.codepoint("힣") local COMPLETE_HANGUL_ALPHABET_START_CHARCODE = utf8.codepoint("ㄱ") local COMPLETE_HANGUL_ALPHABET_END_CHARCODE ...
1,967
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/number/days.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Variables ]#-- local DAYS_MAP = { [1] = "하루"; [2] = "이틀"; [3] = "사흘"; [4] = "나흘"; [5] = "닷새"; [6] = "엿새"; [7] = "이레"; [8] = "여드레"; [9] = "아흐레"; [10] = "열"; [20] = "스무"; } local DAYS_ONLY_TENS_MAP = { [10] = "열흘"; [20] ...
397
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/number/init.luau
luau
.luau
local days = require("@self/days") local numberToHangul = require("@self/numberToHangul") local susa = require("@self/susa") return { days = days; numberToHangul = numberToHangul; susa = susa; }
60
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/number/numberToHangul.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Modules ]#-- local super_table = require("@luau_pkg/super_table") local constants = require("../internal/constants") --#[ Variables ]#-- -- --#[ Functions ]#-- local function formatNumber( number: number ): string local sign, integer, decimal = string.match(tos...
1,425
Word30210/luau-hangul
Word30210-luau-hangul-abb31ba/src/number/susa.luau
luau
.luau
--#[ Head Variables ]#-- local module = {} --#[ Modules ]#-- local numberToHangul = require("./numberToHangul") --#[ Variables ]#-- local SUSA_MAP = { [1] = "하나"; [2] = "둘"; [3] = "셋"; [4] = "넷"; [5] = "다섯"; [6] = "여섯"; [7] = "일곱"; [8] = "여덟"; [9] = "아홉"; [10] = "열"; [20] =...
1,106
JohnnyMorganz/Luau.tmLanguage
JohnnyMorganz-Luau.tmLanguage-a50533f/tests/cases/numeric-integer.luau
luau
.luau
local i1: integer = 123456789i local i2: integer = -1_048_576i local i3: integer = -99i const i4: integer = 0xfedcba9876543210i const i5: integer = -0xFFFF_FFFFi local i6: integer = 0b01010101i local i7: integer = -0b_0101_0101i
96
JohnnyMorganz/Luau.tmLanguage
JohnnyMorganz-Luau.tmLanguage-a50533f/tests/cases/numeric-negative.luau
luau
.luau
local num01 = -123456789 local num02 = -1_048_576 local num03 = -99 const num04 = -0xfedcba9876543210 const num05 = -0xFFFF_FFFF local num06 = -0b01010101 local num07 = -0b_0101_0101 const num08 = -1e5 local num09 = -1e-5 local num10 = -1e+5
104
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.config.luau
luau
.luau
return { luau = { languagemode = "strict", lint = { ["*"] = true }, linterrors = true, aliases = { batteries = "./Packages/lute/batteries", src = "./src", std = "~/.lute/typedefs/0.1.0/std", }, }, }
82
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.lute/generate.luau
luau
.luau
-- Run with: lute run generate -- Unicode data files live in unicode-data/ and are refreshed with: lute run fetch-data local fs = require("@std/fs") local path = require("@std/path") local config = require("./lib/config") local emitModule = require("./lib/emit-module") local parseProperties = require("./lib/parse-pro...
3,030
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.lute/lib/config.luau
luau
.luau
local UNICODE_VERSION = "17.0.0" return { UNICODE_VERSION = UNICODE_VERSION, UNICODE_BASE_URL = "https://www.unicode.org/Public/" .. UNICODE_VERSION .. "/ucd/", UNICODE_DATA_DIR = "unicode-data", UNICODE_FILES = { "auxiliary/GraphemeBreakProperty.txt", "auxiliary/WordBreakProperty.txt", "auxiliary/SentenceBr...
156
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.lute/lib/emit-module.luau
luau
.luau
local fs = require("@std/fs") local base64 = require("@src/base64") type EmitOptions = { categories: { string }, rangeBuffer: buffer, asciiBuffer: buffer, } local function encodeBuffer(data: buffer): string return buffer.tostring(base64.encode(data)) end local function renderDataModule(options: EmitOptions): st...
374
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.lute/lib/fuzz-word.luau
luau
.luau
local base64 = require("@src/base64") local fs = require("@std/fs") local segmenter = require("@src") local wordData = require("@src/generated/word-data") local BYTES_PER_RANGE = 8 local CODEPOINT_MASK = 0x1FFFFF local CATEGORY_SHIFT = 21 local MAX_CODEPOINT = 0x10FFFF local SURROGATE_START = 0xD800 local SURROGATE_E...
2,277
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.lute/lib/parse-properties.luau
luau
.luau
local function trim(value: string): string return (value:gsub("^%s+", ""):gsub("%s+$", "")) end local function parseRangeToken(token: string): (number | nil, number | nil) local rangeStart, rangeEnd = token:match("^(%x+)%.%.(%x+)$") if rangeStart == nil then rangeStart = token:match("^(%x+)$") rangeEnd = rangeS...
694
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/.lute/lib/parse-tests.luau
luau
.luau
local function isSurrogate(codepoint: number): boolean return codepoint >= 0xD800 and codepoint <= 0xDFFF end local function codepointsToString(codepoints: { number }): string local parts = table.create(#codepoints) for index, codepoint in codepoints do parts[index] = utf8.char(codepoint) end return table.conc...
460
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/base64.luau
luau
.luau
--!native --!optimize 2 local lookupValueToCharacter = buffer.create(64) local lookupCharacterToValue = buffer.create(256) local alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" local padding = string.byte("=") for index = 1, 64 do local value = index - 1 local character = string.byte(...
1,875
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/core.luau
luau
.luau
--!native --!optimize 2 local alphabeticData = require("./generated/alphabetic-data") local graphemeData = require("./generated/grapheme-data") local incbData = require("./generated/incb-data") local numericData = require("./generated/numeric-data") local sentenceData = require("./generated/sentence-data") local types...
1,771
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/generated/alphabetic-data.luau
luau
.luau
-- This file was @generated by .lute/generate.luau. Do not edit. local base64 = require("../base64") local rangeData = base64.decode( buffer.fromstring( "QQAAAFoAIABhAAAAegAgAKoAAACqACAAtQAAALUAIAC6AAAAugAgAMAAAADWACAA2AAAAPYAIAD4AAAAwQIgAMYCAADRAiAA4AIAAOQCIADsAgAA7AIgAO4CAADuAiAARQMAAEUDIABjAwAAdAMgAHYDAAB3AyAAegM...
5,230
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/generated/emoji-data.luau
luau
.luau
-- This file was @generated by .lute/generate.luau. Do not edit. local base64 = require("../base64") local rangeData = base64.decode( buffer.fromstring( "qQAAAKkAIACuAAAArgAgADwgAAA8ICAASSAAAEkgIAAiIQAAIiEgADkhAAA5ISAAlCEAAJkhIACpIQAAqiEgABojAAAbIyAAKCMAACgjIADPIwAAzyMgAOkjAADzIyAA+CMAAPojIADCJAAAwiQgAKolAACrJSAAtiU...
1,201
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/generated/incb-data.luau
luau
.luau
-- This file was @generated by .lute/generate.luau. Do not edit. local base64 = require("../base64") local rangeData = base64.decode( buffer.fromstring( "FQkAADkJIABNCQAATQlAAFgJAABfCSAAeAkAAH8JIACVCQAAqAkgAKoJAACwCSAAsgkAALIJIAC2CQAAuQkgAM0JAADNCUAA3AkAAN0JIADfCQAA3wkgAPAJAADxCSAAlQoAAKgKIACqCgAAsAogALIKAACzCiAAtQo...
767
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/generated/numeric-data.luau
luau
.luau
-- This file was @generated by .lute/generate.luau. Do not edit. local base64 = require("../base64") local rangeData = base64.decode( buffer.fromstring( "MAAAADkAIACyAAAAswAgALkAAAC5ACAAvAAAAL4AIABgBgAAaQYgAPAGAAD5BiAAwAcAAMkHIABmCQAAbwkgAOYJAADvCSAA9AkAAPkJIABmCgAAbwogAOYKAADvCiAAZgsAAG8LIAByCwAAdwsgAOYLAADyCyAAZgw...
1,118
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/generated/word-data.luau
luau
.luau
-- This file was @generated by .lute/generate.luau. Do not edit. local base64 = require("../base64") local rangeData = base64.decode( buffer.fromstring( "CgAAAAoAIAELAAAADACgAQ0AAAANAEAAIAAAACAAIAIiAAAAIgBgACcAAAAnAAACLAAAACwAYAEuAAAALgCAATAAAAA5AMABOgAAADoAQAE7AAAAOwBgAUEAAABaACAAXwAAAF8AoABhAAAAegAgAIUAAACFAKABqgA...
7,698
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/grapheme.luau
luau
.luau
--!native --!optimize 2 local core = require("./core") local graphemeData = require("./generated/grapheme-data") local types = require("./types") type Segment = types.GraphemeSegment local categories = graphemeData.categories local GC_ANY = categories.Any local GC_CR = categories.CR local GC_CONTROL = categories.Con...
1,304
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/init.luau
luau
.luau
local core = require("@self/core") local grapheme = require("@self/grapheme") local graphemeData = require("@self/generated/grapheme-data") local sentence = require("@self/sentence") local sentenceData = require("@self/generated/sentence-data") local types = require("@self/types") local word = require("@self/word") loc...
536
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/sentence.luau
luau
.luau
--!native --!optimize 2 local core = require("./core") local sentenceData = require("./generated/sentence-data") local types = require("./types") type Segment = types.SentenceSegment local categories = sentenceData.categories local SC_ATERM = categories.ATerm local SC_CR = categories.CR local SC_CLOSE = categories....
1,999
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/types.luau
luau
.luau
export type Range = { from: number, to: number, category: number, } export type Segment = { segment: string, index: number, } export type WordSegment = { segment: string, index: number, isWordLike: boolean, } export type SentenceSegment = Segment export type GraphemeSegment = Segment return nil
73
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/src/word.luau
luau
.luau
--!native --!optimize 2 local core = require("./core") local emojiData = require("./generated/emoji-data") local types = require("./types") local wordData = require("./generated/word-data") type WordSegment = types.WordSegment local categories = wordData.categories local WC_ANY = categories.Any local WC_ALETTER = ca...
3,323
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/tests/codegen.test.luau
luau
.luau
local fs = require("@std/fs") local test = require("@std/test") local base64 = require("@src/base64") local core = require("@src/core") local parseProperties = require("../.lute/lib/parse-properties").parseProperties local parseTests = require("../.lute/lib/parse-tests").parseTestData local emitModule = require("../....
675
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/tests/grapheme.test.luau
luau
.luau
local test = require("@std/test") local segmenter = require("@src") local testData = require("./test-data") test.suite("GraphemeBreakTest", function(suite) for index, entry in testData.grapheme do suite:case(`case_{index}`, function(assert) local result = segmenter.splitGraphemes(entry.input) assert.eq(entry...
815
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/tests/sentence.test.luau
luau
.luau
local test = require("@std/test") local segmenter = require("@src") local testData = require("./test-data") test.suite("SentenceBreakTest", function(suite) for index, entry in testData.sentence do suite:case(`case_{index}`, function(assert) local result = segmenter.splitSentences(entry.input) assert.eq(entry...
368
BrookenRecord/unicode-segmentation
BrookenRecord-unicode-segmentation-5087607/tests/word.test.luau
luau
.luau
local test = require("@std/test") local segmenter = require("@src") local testData = require("./test-data") local types = require("@src/types") local wordRuntime = require("@src/word") local function collectWordLike(input: string): { string } local segments = segmenter.words(input) local output = {} for _, entry i...
2,298
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Doom/Sounds.luau
luau
.luau
--!native --!optimize 2 -- Port of the musicenum_t and sfxenum_t id slices from sounds.h. -- This is enough to resolve Doom sound/music constants without porting the -- full sound backend. const Sounds: { [string]: number } = {} Sounds.mus_None = 0 Sounds.mus_e1m1 = 1 Sounds.mus_e1m2 = 2 Sounds.mus_e1m3 = 3 Sounds.m...
4,104
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Doom/SpriteNames.luau
luau
.luau
--!native --!optimize 2 -- Sprite name table and spritenum_t values from info.c, info.h. -- Thing frame/state LUT support data used by `Renderer/Things.luau`. const sprnames = { [0] = "TROO", "SHTG", "PUNG", "PISG", "PISF", "SHTF", "SHT2", "CHGG", "CHGF", "MISG", "MISF", "SAWG", "PLSG", "PLSF", "BFGG", "BFGF", "BLU...
1,836
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Engine/Definitions.luau
luau
.luau
--!native --!optimize 2 -- Port of doomdef.c, doomdef.h -- basic defines for DOOM, e.g. Version, game mode -- and skill level, and display parameters. return { -- Global parameters/defines. -- DOOM version VERSION = 110, DEMO_VERSION = 109, DOOM_191_VERSION = 111, -- Game mode handling - identify IWAD version...
1,238
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Engine/Tables.luau
luau
.luau
--!native --!optimize 2 -- Port of tables.c, tables.h -- Lookup tables. --[[ In the order of appearance: finetangent[4096] - Tangens LUT. Should work with BAM fairly well (12 of 16bit, effectively, by shifting). nfinesine[10240] - Sine lookup. Guess what, serves as cosine, too. R...
74,123
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Engine/Timing.luau
luau
.luau
--!optimize 2 --!native --[[ Timing.luau Tracks fixed-timestep frame timing, pending simulation tics, interpolation alpha, and host time. ]] const Definitions = require("./Definitions") const SIMULATION_HZ = Definitions.TICRATE const SECONDS_PER_TIC = 1 / SIMULATION_HZ const EXTERNAL_MAX_CATCH_UP_TICS = 0 l...
576
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Interface/Title.luau
luau
.luau
--!native --!optimize 2 -- Port of the D_Page*/D_AdvanceDemo/D_StartTitle slice from d_main.c. -- Demo playback stays host-driven so the outer engine owns the transition -- into gameplay demo sessions. const Definitions = require("../Engine/Definitions") const Setup = require("../Play/Setup") const Sounds = require("...
1,137
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Miscellaneous/BoundingBox.luau
luau
.luau
--!optimize 2 --!native --[[ BoundingBox.luau Public API: - Module returns bounding box coordinate constants and buffer helpers. - Create returns an initialized bounding box buffer. - ClearBox resets a bounding box buffer. - AddToBox expands a bounding box buffer to include a point. Port of m_bbox.c and m_bbo...
420
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Miscellaneous/Fixed.luau
luau
.luau
--!native --!optimize 2 -- Port of m_fixed.c, m_fixed.h -- Fixed point implementation. const function ToSigned32(value: number): number value = bit32.band(value, 0xFFFFFFFF) return if value >= 2147483648 then value - 4294967296 else value end const function FixedMul(a: number, b: number): number a = T...
469
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Miscellaneous/Random.luau
luau
.luau
--!optimize 2 --!native --[[ Random.luau Public API: - Module returns Doom random number generators backed by the m_random lookup table. - PlayRandom and MenuRandom return 0-255 values. - ClearRandom resets both generator indices. ]] const RndTable = { [0] = 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 14...
973
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Ceiling.luau
luau
.luau
--!native --!optimize 2 -- Port of p_ceilng.c, p_spec.h -- Ceiling animation (lowering, crushing, raising) -- Thinker registration/removal, plane motion, and sound playback come from -- the shared play runtime. -- Note: `getNextSector`, `FindSectorFromLineTag`, and -- `FindHighestCeilingSurrounding` are implemented lo...
2,805
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Doors.luau
luau
.luau
--!native --!optimize 2 -- Port of Doors.c, p_spec.h -- Door animation code (opening/closing) -- Thinker registration/removal, plane motion, and sound playback come from -- the shared play runtime. -- Note: `getNextSector`, `FindSectorFromLineTag`, and -- `FindLowestCeilingSurrounding` are implemented locally ...
3,721
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Floor.luau
luau
.luau
--!native --!optimize 2 -- Port of p_floor.c, p_spec.h -- Floor animation: raising stairs. -- Thinker registration/removal, sector collision updates, and sound playback -- are provided by the shared play runtime. -- Note: `twoSided`, `getSide`, `getSector`, `getNextSector`, -- `FindSectorFromLineTag`, and surr...
5,103
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Host.luau
luau
.luau
--!optimize 2 --!native --[[ Host.luau Exports host callback stubs for play systems when no platform host handlers are installed. ]] const function startSound(...: unknown) end const function startSoundSystem(...: unknown) end const function startStatus(...: unknown) end const function startHUD(...: unknown) en...
245
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Lights.luau
luau
.luau
--!native --!optimize 2 -- Port of p_lights.c -- Handle Sector base lighting effects. -- Muzzle flash? -- Thinker registration goes through the shared play runtime, and this module -- keeps the spawned effect tables as the owner of those light thinkers. -- Note: `getNextSector`, `FindSectorFromLineTag`, and -- `FindMi...
2,648
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/MapUtil.luau
luau
.luau
--!native --!optimize 2 -- Port of p_maputl.c, p_local.h -- Movement/collision utility functions. -- This file ports the block/sector thing-link routines, block iterators, -- line/divline helpers, and `LineOpening`. -- Note: blockmap state is shared through `WorldState.luau`. const Fixed = require("../Miscel...
5,968
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Platforms.luau
luau
.luau
--!native --!optimize 2 -- Port of p_plats.c, p_spec.h -- Plats (i.e. elevator platforms) code, raising/lowering. -- Thinker registration/removal, plane motion, and sound playback come from -- the shared play runtime. const Random = require("../Miscellaneous/Random") const Fixed = require("../Miscellaneous/F...
2,363
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Sight.luau
luau
.luau
--!native --!optimize 2 -- Port of p_sight.c -- LineOfSight/Visibility checks, uses REJECT lookup table. const Fixed = require("../Miscellaneous/Fixed") const MapUtil = require("./MapUtil") const State = require("../Renderer/State") const WorldState = require("./WorldState") const TWOSIDED = 4 const SUBSECTOR = 0x80...
2,371
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/Teleport.luau
luau
.luau
--!native --!optimize 2 -- Port of p_telept.c -- Teleportation. -- Note: fog spawning and sound playback come from the shared play runtime. const Map = require("./Map") const Mobj = require("./Mobj") const Runtime = require("./Runtime") const State = require("../Renderer/State") const Tables = require("../Engine/Tabl...
732
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Play/WorldState.luau
luau
.luau
--!native --!optimize 2 -- Shared play-world state for modules that need map/block/reject data -- without bouncing through per-field indirection. const WorldState = { bmapwidth = 0, bmapheight = 0, blockmap = {}, blockmaplump = {}, bmaporgx = 0, bmaporgy = 0, blocklinks = {}, rejectmatrix = buffer.create(0), ...
185
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Bsp.luau
luau
.luau
--!native --!optimize 2 -- Port of r_bsp.c, r_bsp.h -- BSP traversal, handling of LineSegs for rendering. -- `StoreWallRange` from `Segs.luau` and sprite submission from -- `Things.luau` route through the shared renderer runtime so BSP stays acyclic. const BoundingBox = require("../Miscellaneous/BoundingBox") const G...
4,851
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Data.luau
luau
.luau
--!native --!optimize 2 -- Port of r_data.c, r_data.h -- Refresh module, data I/O, caching, retrieval of graphics -- by name. -- `R_PrecacheLevel` prefers thinker-driven sprite discovery when play code has -- populated the shared renderer host bridge; otherwise it falls back to sector -- thinglists. -- COLORMAP pointe...
6,124
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Draw.luau
luau
.luau
--!native --!optimize 2 -- Port of r_draw.c, r_draw.h -- The actual span/column drawing functions. -- Here find the main potential for optimization, -- e.g. inline assembly, different algorithms. const Definitions = require("../Engine/Definitions") const State = require("./State") const Video = require("../System/Vi...
6,178
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Geometry.luau
luau
.luau
--!native --!optimize 2 -- Port of r_main.c, r_main.h -- Rendering main loop and setup functions, -- utility functions (BSP, geometry, trigonometry). -- See tables.c, too. -- Geometry helpers shared by renderer and play code. const BoundingBox = require("../Miscellaneous/BoundingBox") const Fixed = require(...
1,950
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Host.luau
luau
.luau
--!native --!optimize 2 --[[ Host.luau Provides the renderer host table and resets runtime callback fields. ]] type Host = { getThinkerCap: unknown?, mobjThinker: unknown?, netUpdate: unknown?, Reset: (() -> ())?, } const host: Host = {} const function Reset() host.getThinkerCap = nil host.mobjThinker = ni...
105
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Main.luau
luau
.luau
--!native --!optimize 2 -- Port of r_main.c, r_main.h -- Rendering main loop and setup functions, -- utility functions (BSP, geometry, trigonometry). -- See tables.c, too. -- `RenderPlayerView` calls the renderer owners directly. Shared bridge state -- is only used where direct requires would create cycles. const Fix...
3,346
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Runtime.luau
luau
.luau
--!native --!optimize 2 const runtime: { storeWallRange: unknown?, addSprites: unknown?, Reset: (() -> ())?, } = {} const function Reset() runtime.storeWallRange = nil runtime.addSprites = nil end Reset() runtime.Reset = Reset return runtime
66
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Shared.luau
luau
.luau
--!native --!optimize 2 -- Shared renderer math helpers. -- Keep these leaf-level so renderer modules do not require each other just for -- pure calculations. const Fixed = require("../Miscellaneous/Fixed") const Tables = require("../Engine/Tables") const State = require("./State") const finesine = Tables.finesine ...
322
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/Sky.luau
luau
.luau
--!optimize 2 --!native --[[ Sky.luau Provides sky renderer state accessors and resets sky texture midpoint for view changes. ]] const SKYFLATNAME = "F_SKY1" const ANGLETOSKYSHIFT = 22 -- sky mapping -- `skyflatnum` is assigned by play/setup code after flats are initialized. local skyflatnum = 0 local skytexture ...
288
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/SpriteState.luau
luau
.luau
--!optimize 2 --!native --[[ SpriteState.luau Shared renderer sprite clipping and masked-column draw state. ]] type SpriteState = { Reset: () -> (), negonearray: buffer | false, screenheightarray: buffer | false, maskedColumnDrawer: ((buffer, number) -> ())?, maskedFloorClip: buffer | false, maskedCeilingCli...
281
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/Renderer/State.luau
luau
.luau
--!native --!optimize 2 -- Port of r_state.h -- Refresh/render internal state variables (global). -- Some values intentionally stay unset until their owning renderer module runs: -- `colormaps` from `Renderer/Data`, `viewplayer` from `Renderer/Main`, -- `sprites` from `Renderer/Things`, and `floorplane` / `ceilingplan...
903
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/System/Sound.luau
luau
.luau
--!native --!optimize 2 -- Port of the high-level s_sound.c/s_sound.h ownership layer. -- Actual backend playback stays host-driven for the runtime. const Definitions = require("../Engine/Definitions") const Sounds = require("../Doom/Sounds") const Fixed = require("../Miscellaneous/Fixed") const Tables = require("../...
5,019
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/System/Video.luau
luau
.luau
--!native --!optimize 2 -- Port of v_video.c, v_video.h -- Gamma correction LUT stuff. -- Functions to draw patches (by post) directly to screen. -- Functions to blit a block to the screen. const Definitions = require("../Engine/Definitions") const BoundingBox = require("../Miscellaneous/BoundingBox") const...
8,408
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/System/VideoMode.luau
luau
.luau
--!native --!optimize 2 const Definitions = require("../Engine/Definitions") const STATUSBAR_LOGICAL_HEIGHT = 32 const ALLOWED_RENDER_SIZES = { ["320x200"] = 1, ["640x400"] = 2, ["960x600"] = 3, } const State = { LogicalWidth = Definitions.BASE_WIDTH, LogicalHeight = Definitions.BASE_HEIGHT, LogicalHalfWidth ...
1,908
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/System/Wad.luau
luau
.luau
--!native --!optimize 2 -- Port of w_wad.c, w_wad.h -- Handles WAD file header, directory, lump I/O. -- Buffer-based WAD directory parsing and lump access. -- TODO: Add an InitMultipleFiles-style buffer wrapper if higher-level boot code wants it. -- TODO: Add a Reload equivalent if live map/WAD replacement is needed. ...
2,132
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/System/Wipe.luau
luau
.luau
--!native --!optimize 2 -- Port of f_wipe.c, f_wipe.h -- DESCRIPTION: -- Mission begin melt/wipe screen special effect. -- Mission start screen wipe/melt, special effects. const Random = require("../Miscellaneous/Random") const Video = require("./Video") -- simple gradual pixel change for 8-bit only co...
2,108
vantoanvh/LuauDOOM
vantoanvh-LuauDOOM-2dbeeb2/LuauDOOM/System/Zone.luau
luau
.luau
--!native --!optimize 2 -- Port of z_zone.c, z_zone.h -- Zone Memory Allocation. Neat. -- This Luau port emulates Doom's memblock list and rover behavior. -- Ownership still uses `ownerTable` + `ownerKey` instead of C pointers. -- ZONE MEMORY -- PU - purge tags. -- Tags < 100 are not overwritten until freed. const ST...
1,680
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/.lune/exec.luau
luau
.luau
--> lib: Builder pattern class to spawn child processes local stdio = require("@lune/stdio") local process = require("@lune/process") local Option = require("../lune_packages/option") type Option<T> = Option.Option<T> local CommandBuilder = {} export type CommandBuilder = typeof(setmetatable({} :: Command...
850
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/.lune/fmt.luau
luau
.luau
--> Run stylua to check for formatting errors local process = require("@lune/process") local CommandBuilder = require("./exec") process.exit( CommandBuilder.new("pesde") :withArgs({ "run", "./bins/stylua" }) :withArg("--") :withArgs(process.args) :withStdioStrategy("forward") :exec().code )
86
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/.lune/typecheck.luau
luau
.luau
--> Run luau-lsp analysis to check for type errors local process = require("@lune/process") local CommandBuilder = require("./exec") process.exit( CommandBuilder.new("pesde") :withArgs({ "run", "./bins/luau_lsp" }) :withArgs({ "--", "analyze" }) :withArgs({ "--settings", ".vscode/settings.json" }) :withArgs...
141
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/argon/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("argon-rbx/argon", _G.PESDE_ROOT) return process.exit(exitCode)
43
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/asphalt/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("jackTabsCode/asphalt", _G.PESDE_ROOT) return process.exit(exitCode)
43
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/darklua/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("seaofvoices/darklua", _G.PESDE_ROOT) return process.exit(exitCode)
44
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/luau_lsp/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("JohnnyMorganz/luau-lsp", _G.PESDE_ROOT) return process.exit(exitCode)
47
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/mantle/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("blake-mealey/mantle", _G.PESDE_ROOT) return process.exit(exitCode)
45
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/rojo/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("rojo-rbx/rojo", _G.PESDE_ROOT) return process.exit(exitCode)
45
pesde-pkg/tooling
pesde-pkg-tooling-2c980ab/bins/selene/init.luau
luau
.luau
local process = require("@lune/process") local exitCode = require("@self/lune_packages/toolchainlib")("Kampfkarren/selene", _G.PESDE_ROOT) return process.exit(exitCode)
46