Welcome to mirror list, hosted at ThFree Co, Russian Federation.

doc.lua - github.com/torch/argcheck.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3acfb5e1b0cc9106eb9fc70a4db018f893a8d1ad (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
local doc = {}

function doc.record()
   doc.__record = {}
end

function doc.stop()
   local md = table.concat(doc.__record)
   doc.__record = nil
   return md
end

function doc.doc(str)
   if doc.__record then
      table.insert(doc.__record, str)
   end
end

setmetatable(doc, {__call=
                      function(self, ...)
                         return self.doc(...)
                      end})

return doc