Skip to content

Commit

Permalink
Merge pull request #1 from Someon1e/main
Browse files Browse the repository at this point in the history
Remove non-existent builtins and keywords
  • Loading branch information
robloxiandemo authored Nov 12, 2024
2 parents 7cddd73 + a08c818 commit 67448bd
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/languages/luau.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,29 @@ export default function (hljs) {

const BUILT_IN =
// Lua metatags and globals:
'_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len ' +
'_G _VERSION __index __newindex __mode __call __metatable __tostring __len ' +
'__gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert ' +
// New in Luau (metatags -> globals)
'__idiv __iter newproxy rawlen ' +
// Standard methods and properties:
'collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring ' +
'collectgarbage error getfenv getmetatable ipairs loadstring ' +
'module next pairs pcall print rawequal rawget rawset require select setfenv ' +
'setmetatable tonumber tostring type unpack xpcall arg self ' +
'setmetatable tonumber tostring type unpack xpcall self ' +
// Library methods and properties (one line per library):
'coroutine resume yield status wrap create running debug getupvalue ' +
'debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv ' +
'io lines write close flush open output type read stderr stdin input stdout popen tmpfile ' +
'coroutine resume yield status wrap create running ' +
'debug traceback ' +
'math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan ' +
'os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall ' +
'string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower ' +
'table setn insert getn foreachi maxn foreach concat sort remove';
'os date difftime time clock ' +
'string sub upper len rep find match char gmatch reverse byte format gsub lower ' +
'table insert getn foreachi maxn foreach concat sort remove';

return {
name: 'Luau',
keywords: {
$pattern: hljs.UNDERSCORE_IDENT_RE,
literal: 'true false nil',
keyword:
'and break do else elseif end for goto if in local not or repeat return then until while',
'and break do else elseif end for if in local not or repeat return then until while',
built_in: BUILT_IN
},
contains: COMMENTS.concat([
Expand Down

0 comments on commit 67448bd

Please sign in to comment.