blob: a89199128fad0fd8d1d148b5ace815a4c72f18c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
--
-- Copyright (c) 2021-2023 Zeping Lee
-- Released under the MIT license.
-- Repository: https://github.com/zepinglee/citeproc-lua
--
local group = {}
local element
local ir_node
local util
if kpse then
element = require("citeproc-element")
ir_node = require("citeproc-ir-node")
util = require("citeproc-util")
else
element = require("citeproc.element")
ir_node = require("citeproc.ir-node")
util = require("citeproc.util")
end
local SeqIr = ir_node.SeqIr
local Element = element.Element
local Group = Element:derive("group")
function Group:from_node(node)
local o = Group:new()
o:get_delimiter_attribute(node)
o:set_affixes_attributes(node)
o:set_display_attribute(node)
o:set_formatting_attributes(node)
o:process_children_nodes(node)
return o
end
function Group:build_ir(engine, state, context)
local ir = self:build_group_ir(engine, state, context)
if ir then
ir.delimiter = self.delimiter
ir.formatting = util.clone(self.formatting)
ir.affixes = util.clone(self.affixes)
ir.display = self.display
end
return ir
end
group.Group = Group
return group
|