--// made by sillzchibi. if you wanna learn about luau syntax go here: https://luau.org/syntax/ local typ, out, wrn = type, print, warn local loadstring_ok = false if typ(loadstring) == "function" then local success_func, success_err = loadstring("return true", "expected_success") local fail_func, fail_err = loadstring("return @@@", "expected_failer") if success_func and not success_err and not fail_func and fail_err then loadstring_ok = true end end if not loadstring_ok then return error("seems the current executor doesn't have loadstring() or has a bad loadstring. test canceled", 3) end local executor, ver = "{unknown executor?}", " " if typ(identifyexecutor) == "function" then executor, ver = identifyexecutor() end local strload = loadstring local tests = { { name = "Generalized iteration", code = "local t = {1, 2}; for k, v in t do end" }, { name = "String interpolation", code = [[local name = "bob" ; print(`Hi, {name}!`)]]}, { name = "Floor division", code = "local _ = 5 // 2" }, { name = "If-then-else expressions", code = "local _ = if true then 1 else 2" }, { name = "Compound assignments", code = "local x = 1; x += 1" }, { name = "Attributes", code = [[ @[deprecated { use = "newApi()", reason = "newApi is faster and supports all value types.", }] local function oldApi() return end ]]}, { name = "Type annotations", code = [[ local a: number = 1 export type test = { example: any? } type function typfunc(obj: any): (any) return obj end type final = typfunc local b: final = { example = 1 } ]]}, { name = "Const bindings", code = "const x = 5" } } local passed = 0 local total = #tests out("executor: "..executor.." "..ver) for i = 1, total do local test = tests[i] local chunk, err = strload(test.code, "SyntaxChecker") if chunk and not err then passed = passed + 1 out(test.name .. " ✅️") else local clean_err = err or "unknown error" wrn(test.name .. " ❌️ - syntax error: " .. clean_err) end end out("tests: " .. passed .. "/" .. total) local percentage = math.floor((passed / total) * 100) out("total luau syntax support: " .. percentage .. "%") if passed == total then out("all " .. passed .. "/" .. total .. " tests passed seems your executor fully supports luau syntax✅️") else wrn("failed. " .. passed .. "/" .. total .. " tests passed your executor doesn't fully support luau syntax ❌️") end