• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sile-typesetter / sile / 11170735472

03 Oct 2024 10:32PM UTC coverage: 58.612% (-4.5%) from 63.103%
11170735472

push

github

web-flow
Merge bcab25790 into 783083345

15 of 64 new or added lines in 5 files covered. (23.44%)

828 existing lines in 41 files now uncovered.

10478 of 17877 relevant lines covered (58.61%)

2029.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.74
/inputters/ast.lua
1
local base = require("inputters.base")
30✔
2
local serpent = require("serpent")
30✔
3

4
local inputter = pl.class(base)
30✔
5
inputter._name = "ast"
30✔
6

7
inputter.order = 35
30✔
8

9
function inputter.appropriate (round, filename, doc)
30✔
10
   if round == 1 then
23✔
11
      return filename:match(".ast$")
23✔
NEW
12
   elseif round == 2 then
×
NEW
13
      local sniff = doc:sub(1, 100)
×
NEW
14
      local promising = sniff:match("^{\n   [^ ]") or sniff:match("command =") or sniff:match("loadstring or load")
×
NEW
15
      return promising and inputter.appropriate(3, filename, doc) or false
×
NEW
16
   elseif round == 3 then
×
NEW
17
      local status, _ = serpent.load(doc, { safe = true })
×
NEW
18
      return status and true or false
×
19
   end
20
end
21

22
function inputter.parse (_, doc)
30✔
NEW
23
   local status, result = serpent.load(doc, { safe = true })
×
NEW
24
   if not status then
×
NEW
25
      SU.error(result)
×
26
   end
NEW
27
   return result
×
28
end
29

30
function inputter:process (doc)
30✔
NEW
31
   local tree = self:parse(doc)
×
NEW
32
   if not tree.type then
×
33
      -- hoping tree is an AST
NEW
34
      self:requireClass(tree)
×
NEW
35
      return SILE.process(tree)
×
36
   else
NEW
37
      SILE.use(tree, self.options)
×
38
   end
39
end
40

41
return inputter
30✔
42

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc