diff options
| author | Steven Sojka <steelsojka@users.noreply.github.com> | 2021-03-30 08:18:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-30 08:18:24 -0500 |
| commit | 6863f79118d3cb331fd4e726cdb2384bbd8bf8f2 (patch) | |
| tree | c703b490f9c3e7e601e673704984b42f9edfe6ab /lua/nvim-treesitter/utils.lua | |
| parent | 0df7c4aa39a6097e112f001520d2cea257440ed7 (diff) | |
refactor(all): language tree adaption (#1105)
Diffstat (limited to 'lua/nvim-treesitter/utils.lua')
| -rw-r--r-- | lua/nvim-treesitter/utils.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lua/nvim-treesitter/utils.lua b/lua/nvim-treesitter/utils.lua index f82c2d4a..ab8498b0 100644 --- a/lua/nvim-treesitter/utils.lua +++ b/lua/nvim-treesitter/utils.lua @@ -166,4 +166,16 @@ function M.difference(tbl1, tbl2) end) end +function M.identity(a) + return a +end + +function M.constant(a) + return function() return a end +end + +function M.to_func(a) + return type(a) == 'function' and a or M.constant(a) +end + return M |
