compat.lua 519 B

12345678910111213
  1. -- Lua 5.1 forward-compatibility layer.
  2. -- For background see https://github.com/neovim/neovim/pull/9280
  3. --
  4. -- Reference the lua-compat-5.2 project for hints:
  5. -- https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/compat52/mstrict.lua
  6. -- https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/tests/test.lua
  7. local lua_version = _VERSION:sub(-3)
  8. if lua_version >= '5.2' then
  9. unpack = table.unpack -- luacheck: ignore 121 143
  10. end