~reviczky/context/mirror

« back to all changes in this revision

Viewing changes to tex/context/base/mkiv/strc-ref.lua

  • Committer: Context Git Mirror Bot
  • Author(s): Hans Hagen
  • Date: 2019-09-10 19:16:35 UTC
  • Revision ID: git-v1:58c7c9288160407c874930aac789ef6ef3faa6b5
2019-09-10 20:11:00

Show diffs side-by-side

added added

removed removed

Lines of Context:
2603
2603
    arguments = { "string", "boolean", "boolean" }
2604
2604
}
2605
2605
 
2606
 
local function referencerealpage()
 
2606
-- local function referencerealpage()
 
2607
--     local actions = references.currentset
 
2608
--     return not actions and 0 or actions.realpage or setreferencerealpage(actions)
 
2609
-- end
 
2610
--
 
2611
-- implement {
 
2612
--     name      = "referencerealpage",
 
2613
--     actions   = { referencerealpage, context },
 
2614
--  -- arguments = "string" -- hm, weird
 
2615
-- }
 
2616
--
 
2617
-- implement {
 
2618
--     name      = "referencerealpage",
 
2619
--     actions   = function()
 
2620
--         local actions = references.currentset
 
2621
--         context(not actions and 0 or actions.realpage or setreferencerealpage(actions))
 
2622
--     end
 
2623
-- }
 
2624
 
 
2625
local function referencepos(key)
2607
2626
    local actions = references.currentset
2608
 
    return not actions and 0 or actions.realpage or setreferencerealpage(actions)
 
2627
    local i = actions[1].i -- brrr
 
2628
    local v = 0
 
2629
    if i then
 
2630
        local a = i.references
 
2631
        if a then
 
2632
            v = a[key] or 0
 
2633
        end
 
2634
    end
 
2635
    context("%p",v)
2609
2636
end
2610
2637
 
2611
 
implement {
2612
 
    name      = "referencerealpage",
2613
 
    actions   = { referencerealpage, context },
2614
 
    arguments = "string"
2615
 
}
 
2638
implement { name = "referenceposx", actions = function() referencepos("x") end }
 
2639
implement { name = "referenceposy", actions = function() referencepos("y") end }
2616
2640
 
2617
2641
local plist, nofrealpages
2618
2642