| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- [[
- ["bracketedComment",2,"start"],
- ["comment","--[[--"]
- ],[
- ["bracketedComment",2,"start"],
- ["comment","num_args takes in 5.1 byte code and extracts the number of arguments"]
- ],[
- ["bracketedComment",2,"start"],
- ["comment","from its function header."]
- ],[
- "start",
- ["comment","--]]--"]
- ],[
- "start"
- ],[
- "start",
- ["keyword","function"],
- ["text"," "],
- ["identifier","int"],
- ["paren.lparen","("],
- ["identifier","t"],
- ["paren.rparen",")"]
- ],[
- "start",
- ["text","\t"],
- ["keyword","return"],
- ["text"," "],
- ["identifier","t"],
- ["keyword.operator",":"],
- ["support.function","byte"],
- ["paren.lparen","("],
- ["constant.numeric","1"],
- ["paren.rparen",")"],
- ["keyword.operator","+"],
- ["identifier","t"],
- ["keyword.operator",":"],
- ["support.function","byte"],
- ["paren.lparen","("],
- ["constant.numeric","2"],
- ["paren.rparen",")"],
- ["keyword.operator","*"],
- ["constant.numeric","0x100"],
- ["keyword.operator","+"],
- ["identifier","t"],
- ["keyword.operator",":"],
- ["support.function","byte"],
- ["paren.lparen","("],
- ["constant.numeric","3"],
- ["paren.rparen",")"],
- ["keyword.operator","*"],
- ["constant.numeric","0x10000"],
- ["keyword.operator","+"],
- ["identifier","t"],
- ["keyword.operator",":"],
- ["support.function","byte"],
- ["paren.lparen","("],
- ["constant.numeric","4"],
- ["paren.rparen",")"],
- ["keyword.operator","*"],
- ["constant.numeric","0x1000000"]
- ],[
- "start",
- ["keyword","end"]
- ],[
- "start"
- ],[
- "start",
- ["keyword","function"],
- ["text"," "],
- ["identifier","num_args"],
- ["paren.lparen","("],
- ["identifier","func"],
- ["paren.rparen",")"]
- ],[
- "start",
- ["text","\t"],
- ["keyword","local"],
- ["text"," "],
- ["support.function","dump"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["constant.library","string"],
- ["text","."],
- ["support.function","dump"],
- ["paren.lparen","("],
- ["identifier","func"],
- ["paren.rparen",")"]
- ],[
- "start",
- ["text","\t"],
- ["keyword","local"],
- ["text"," "],
- ["identifier","offset"],
- ["text",", "],
- ["identifier","cursor"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["identifier","int"],
- ["paren.lparen","("],
- ["support.function","dump"],
- ["keyword.operator",":"],
- ["support.function","sub"],
- ["paren.lparen","("],
- ["constant.numeric","13"],
- ["paren.rparen","))"],
- ["text",", "],
- ["identifier","offset"],
- ["text"," "],
- ["keyword.operator","+"],
- ["text"," "],
- ["constant.numeric","26"]
- ],[
- "start",
- ["text","\t"],
- ["comment","--Get the params and var flag (whether there's a ... in the param)"]
- ],[
- "start",
- ["text","\t"],
- ["keyword","return"],
- ["text"," "],
- ["support.function","dump"],
- ["keyword.operator",":"],
- ["support.function","sub"],
- ["paren.lparen","("],
- ["identifier","cursor"],
- ["paren.rparen",")"],
- ["keyword.operator",":"],
- ["support.function","byte"],
- ["paren.lparen","("],
- ["paren.rparen",")"],
- ["text",", "],
- ["support.function","dump"],
- ["keyword.operator",":"],
- ["support.function","sub"],
- ["paren.lparen","("],
- ["identifier","cursor"],
- ["keyword.operator","+"],
- ["constant.numeric","1"],
- ["paren.rparen",")"],
- ["keyword.operator",":"],
- ["support.function","byte"],
- ["paren.lparen","("],
- ["paren.rparen",")"]
- ],[
- "start",
- ["keyword","end"]
- ],[
- "start"
- ],[
- "start",
- ["comment","-- Usage:"]
- ],[
- "start",
- ["identifier","num_args"],
- ["paren.lparen","("],
- ["keyword","function"],
- ["paren.lparen","("],
- ["identifier","a"],
- ["text",","],
- ["identifier","b"],
- ["text",","],
- ["identifier","c"],
- ["text",","],
- ["identifier","d"],
- ["text",", "],
- ["keyword.operator","..."],
- ["paren.rparen",")"],
- ["text"," "],
- ["keyword","end"],
- ["paren.rparen",")"],
- ["text"," "],
- ["comment","-- return 4, 7"]
- ],[
- "start"
- ],[
- "start",
- ["comment","-- Python styled string format operator"]
- ],[
- "start",
- ["keyword","local"],
- ["text"," "],
- ["identifier","gm"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["constant.library","debug"],
- ["text","."],
- ["support.function","getmetatable"],
- ["paren.lparen","("],
- ["string","\"\""],
- ["paren.rparen",")"]
- ],[
- "start"
- ],[
- "start",
- ["identifier","gm"],
- ["text","."],
- ["support.function","__mod"],
- ["keyword.operator","="],
- ["keyword","function"],
- ["paren.lparen","("],
- ["identifier","self"],
- ["text",", "],
- ["identifier","other"],
- ["paren.rparen",")"]
- ],[
- "start",
- ["text"," "],
- ["keyword","if"],
- ["text"," "],
- ["support.function","type"],
- ["paren.lparen","("],
- ["identifier","other"],
- ["paren.rparen",")"],
- ["text"," "],
- ["keyword.operator","~="],
- ["text"," "],
- ["string","\"table\""],
- ["text"," "],
- ["keyword","then"],
- ["text"," "],
- ["identifier","other"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["paren.lparen","{"],
- ["identifier","other"],
- ["paren.rparen","}"],
- ["text"," "],
- ["keyword","end"]
- ],[
- "start",
- ["text"," "],
- ["keyword","for"],
- ["text"," "],
- ["identifier","i"],
- ["text",","],
- ["identifier","v"],
- ["text"," "],
- ["keyword","in"],
- ["text"," "],
- ["support.function","ipairs"],
- ["paren.lparen","("],
- ["identifier","other"],
- ["paren.rparen",")"],
- ["text"," "],
- ["keyword","do"],
- ["text"," "],
- ["identifier","other"],
- ["paren.lparen","["],
- ["identifier","i"],
- ["paren.rparen","]"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["support.function","tostring"],
- ["paren.lparen","("],
- ["identifier","v"],
- ["paren.rparen",")"],
- ["text"," "],
- ["keyword","end"]
- ],[
- "start",
- ["text"," "],
- ["keyword","return"],
- ["text"," "],
- ["identifier","self"],
- ["keyword.operator",":"],
- ["support.function","format"],
- ["paren.lparen","("],
- ["support.function","unpack"],
- ["paren.lparen","("],
- ["identifier","other"],
- ["paren.rparen","))"]
- ],[
- "start",
- ["keyword","end"]
- ],[
- "start"
- ],[
- ["bracketedString",5,"start"],
- ["support.function","print"],
- ["paren.lparen","("],
- ["comment","[===["]
- ],[
- ["bracketedString",5,"start"],
- ["comment"," blah blah %s, (%d %d)"]
- ],[
- "start",
- ["comment","]===]"],
- ["keyword.operator","%"],
- ["paren.lparen","{"],
- ["string","\"blah\""],
- ["text",", "],
- ["identifier","num_args"],
- ["paren.lparen","("],
- ["identifier","int"],
- ["paren.rparen",")})"]
- ],[
- "start"
- ],[
- ["bracketedComment",3,"start"],
- ["comment","--[=[--"]
- ],[
- ["bracketedComment",3,"start"],
- ["comment","table.maxn is deprecated, use # instead."]
- ],[
- "start",
- ["comment","--]=]--"]
- ],[
- "start",
- ["support.function","print"],
- ["paren.lparen","("],
- ["constant.library","table"],
- ["text","."],
- ["invalid.deprecated","maxn"],
- ["paren.lparen","{"],
- ["constant.numeric","1"],
- ["text",","],
- ["constant.numeric","2"],
- ["text",","],
- ["paren.lparen","["],
- ["constant.numeric","4"],
- ["paren.rparen","]"],
- ["keyword.operator","="],
- ["constant.numeric","4"],
- ["text",","],
- ["paren.lparen","["],
- ["constant.numeric","8"],
- ["paren.rparen","]"],
- ["keyword.operator","="],
- ["constant.numeric","8"],
- ["paren.rparen",")"],
- ["text"," "],
- ["comment","-- outputs 8 instead of 2"]
- ],[
- "start"
- ],[
- "start",
- ["support.function","print"],
- ["paren.lparen","("],
- ["constant.numeric","5"],
- ["text"," "],
- ["comment","--[[ blah ]]"],
- ["paren.rparen",")"]
- ]]
|