mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-11 18:03:30 +08:00
Add code lua quotes (#4143) 4rivappa
* adding code_lua.json file for quotes section * adding lua quotes from lua manual --------- Co-authored-by: 4rivappa <arivappa21@gmail.com>
This commit is contained in:
parent
cb9a54810d
commit
56c51add7d
1 changed files with 83 additions and 0 deletions
83
frontend/static/quotes/code_lua.json
Normal file
83
frontend/static/quotes/code_lua.json
Normal file
|
@ -0,0 +1,83 @@
|
|||
{
|
||||
"language": "code_lua",
|
||||
"groups": [
|
||||
[0, 100],
|
||||
[101, 300],
|
||||
[301, 600],
|
||||
[601, 9999]
|
||||
],
|
||||
"quotes": [
|
||||
{
|
||||
"text": "local MultiSelect = {}\\nMultiSelect.__index = MultiSelect\\n\\nfunction MultiSelect:new()\\n\\treturn setmetatable({\\n\\t\\t_entries = {},\\n\\t}, MultiSelect)\\nend",
|
||||
"source": "Github nvim-telescope/telescope.nvim - pickers",
|
||||
"length": 156,
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"text": "function histories.History:append(line, picker, no_reset)\\n\\tif not self.enabled then\\n\\t\\treturn\\n\\tend\\n\\tself._append(self, line, picker, no_reset)\\nend",
|
||||
"source": "Github nvim-telescope/telescope.nvim - actions",
|
||||
"length": 155,
|
||||
"id": 2
|
||||
},
|
||||
{
|
||||
"text": "local function require_on_exported_call(mod)\\n\\treturn setmetatable({}, {\\n\\t\\t__index = function(_, picker)\\n\\t\\t\\treturn function(...)\\n\\t\\t\\t\\treturn require(mod)[picker](...)\\n\\t\\t\\tend\\n\\t\\tend,\\n\\t})\\nend",
|
||||
"source": "Github nvim-telescope/telescope.nvim - builtin",
|
||||
"length": 210,
|
||||
"id": 3
|
||||
},
|
||||
{
|
||||
"text": "function M.get_length()\\n\\tlog.trace(\"_get_length()\")\\n\\treturn table.maxn(harpoon.get_term_config().cmds)\\nend",
|
||||
"source": "Github ThePrimeagen/harpoon - tmux",
|
||||
"length": 111,
|
||||
"id": 4
|
||||
},
|
||||
{
|
||||
"text": "for _, v in pairs(log_levels) do\\n\\toverride(v)\\nend",
|
||||
"source": "Github ThePrimeagen/harpoon - dev",
|
||||
"length": 52,
|
||||
"id": 5
|
||||
},
|
||||
{
|
||||
"text": "function M.clear_all()\\n\\tharpoon.get_mark_config().marks = {}\\n\\tlog.trace(\"clear_all(): Clearing all marks.\")\\n\\temit_changed()\\nend",
|
||||
"source": "Github ThePrimeagen/harpoon - mark",
|
||||
"length": 134,
|
||||
"id": 6
|
||||
},
|
||||
{
|
||||
"text": "s = \"hello world from Lua\"\\nfor w in string.gmatch(s, \"%a+\") do\\n\\tprint(w)\\nend",
|
||||
"source": "Lua 5.4 manual - string.gmatch",
|
||||
"length": 80,
|
||||
"id": 7
|
||||
},
|
||||
{
|
||||
"text": "local i = 1\\nwhile a[i] do\\n\\tprint(a[i])\\n\\ti = i + 1\\nend",
|
||||
"source": "Lua pil - while",
|
||||
"length": 59,
|
||||
"id": 8
|
||||
},
|
||||
{
|
||||
"text": "-- print the first non-empty line\\nrepeat\\n\\tline = io.read()\\nuntil line ~= \"\"\\nprint(line)",
|
||||
"source": "Lua pil - repeat",
|
||||
"length": 92,
|
||||
"id": 9
|
||||
},
|
||||
{
|
||||
"text": "function perm (a)\\n\\tlocal n = table.getn(a)\\n\\treturn coroutine.wrap(function () permgen(a, n) end)\\nend",
|
||||
"source": "Lua pil - coroutines",
|
||||
"length": 105,
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"text": "function Set (list)\\n\\tlocal set = {}\\n\\tfor _, l in ipairs(list) do set[l] = true end\\n\\treturn set\\nend",
|
||||
"source": "Lua pil - set",
|
||||
"length": 105,
|
||||
"id": 11
|
||||
},
|
||||
{
|
||||
"text": "line = io.read()\\nn = tonumber(line)\\nif n == nil then\\n\\terror(line .. \" is not a valid number\")\\nelse\\n\\tprint(n*2)\\nend",
|
||||
"source": "Lua pil - strings",
|
||||
"length": 122,
|
||||
"id": 12
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue