summaryrefslogtreecommitdiff
path: root/biblio/citation-style-language/citeproc-node-group.lua
diff options
context:
space:
mode:
Diffstat (limited to 'biblio/citation-style-language/citeproc-node-group.lua')
-rw-r--r--biblio/citation-style-language/citeproc-node-group.lua37
1 files changed, 20 insertions, 17 deletions
diff --git a/biblio/citation-style-language/citeproc-node-group.lua b/biblio/citation-style-language/citeproc-node-group.lua
index 51969212ba..81132a77dc 100644
--- a/biblio/citation-style-language/citeproc-node-group.lua
+++ b/biblio/citation-style-language/citeproc-node-group.lua
@@ -6,33 +6,36 @@
local group = {}
-local element = require("citeproc-element")
+local SeqIr = require("citeproc-ir-node").SeqIr
+local Element = require("citeproc-element").Element
local util = require("citeproc-util")
-local Group = element.Element:new()
+local Group = Element:derive("group")
-function Group:render (item, context)
- self:debug_info(context)
- context = self:process_context(context)
+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)
- local num_variable_attempt = #context.variable_attempt
+ o:process_children_nodes(node)
- local res = self:render_children(item, context)
+ return o
+end
- if #context.variable_attempt > num_variable_attempt then
- if not util.any(util.slice(context.variable_attempt, num_variable_attempt + 1)) then
- res = nil
- 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
-
- res = self:format(res, context)
- res = self:wrap(res, context)
- res = self:display(res, context)
- return res
+ return ir
end
-
group.Group = Group
return group