summaryrefslogtreecommitdiff
path: root/mac/.config/mpv/script-modules/utf8/primitives/init.lua
blob: df28ef3a4b312d8b8079db4c180890ea4e32e1d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
return function(utf8)

local provided = utf8.config.primitives

if provided then
  if type(provided) == "table" then
    return provided
  elseif type(provided) == "function" then
    return provided(utf8)
  else
    return utf8:require(provided)
  end
end

if pcall(require, "tarantool") then
  return utf8:require "primitives.tarantool"
elseif pcall(require, "ffi") then
  return utf8:require "primitives.native"
else
  return utf8:require "primitives.dummy"
end

end