summaryrefslogtreecommitdiff
path: root/script/core/substring.lua
blob: cfce52821abae62104cba53dfb69b3c7c2f15e5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
local guide = require 'parser.guide'

return function (state)
    ---@param pos1 parser.position
    ---@param pos2 parser.position
    ---@return string
    return function (pos1, pos2)
        return state.lua:sub(
            guide.positionToOffset(state, pos1),
            guide.positionToOffset(state, pos2)
        )
    end
end