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

sile-typesetter / sile / 9304060604

30 May 2024 02:07PM UTC coverage: 74.124% (-0.6%) from 74.707%
9304060604

push

github

alerque
style: Reformat Lua with stylua

8104 of 11995 new or added lines in 184 files covered. (67.56%)

15 existing lines in 11 files now uncovered.

12444 of 16788 relevant lines covered (74.12%)

7175.1 hits per line

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

0.0
/languages/jv.lua
NEW
1
local lpeg = require("lpeg")
×
2

3
local types = {
×
4
   "Bi",
5
   "Bi",
6
   "CSR",
7
   "Vs",
8
   "VI",
9
   "VI",
10
   "VI",
11
   "VI",
12
   "VI",
13
   "C",
14
   "C",
15
   "C",
16
   "VI",
17
   "VI",
18
   "VI",
19
   "C",
20
   "C",
21
   "C",
22
   "C",
23
   "C",
24
   "C",
25
   "C",
26
   "C",
27
   "C",
28
   "C",
29
   "C",
30
   "C",
31
   "C",
32
   "C",
33
   "C",
34
   "C",
35
   "C",
36
   "C",
37
   "C",
38
   "C",
39
   "C",
40
   "C",
41
   "C",
42
   "C",
43
   "C",
44
   "C",
45
   "C",
46
   "C",
47
   "C",
48
   "C",
49
   "C",
50
   "C",
51
   "C",
52
   "C",
53
   "C",
54
   "C",
55
   "N",
56
   "M",
57
   "M",
58
   "M",
59
   "M",
60
   "M",
61
   "M",
62
   "M",
63
   "M",
64
   "M",
65
   "CS",
66
   "CM",
67
   "CM",
68
   "V",
69
   "x",
70
   "x",
71
   "x",
72
   "x",
73
   "x",
74
   "x",
75
   "x",
76
   "x",
77
   "x",
78
   "x",
79
   "x",
80
   "x",
81
   "x",
82
   "x",
83
   "x",
84
   "Nd",
85
   "Nd",
86
   "Nd",
87
   "Nd",
88
   "Nd",
89
   "Nd",
90
   "Nd",
91
   "Nd",
92
   "Nd",
93
   "Nd",
94
   "x",
95
   "x",
96
   "x",
97
   "x",
98
   "x",
99
   "x",
100
}
101
local jv = {}
×
102
local P8 = function (c)
NEW
103
   return lpeg.P(luautf8.char(c))
×
104
end
105

106
for i = 1, #types do
×
NEW
107
   local cp = i - 1 + 0xA980
×
NEW
108
   local match = P8(cp)
×
NEW
109
   jv[types[i]] = jv[types[i]] and (jv[types[i]] + match) or match
×
110
end
111

112
jv.medial_ra = P8(0xA9BF)
×
113
jv.medial_ya = P8(0xA9BE)
×
NEW
114
jv.tarung = P8(0xA9B4)
×
115
jv.consonant = ((jv.C * jv.N) + jv.C + jv.VI)
×
116
jv.consonant_sign = jv.Bi + jv.CSR + jv.Vs + jv.CM
×
NEW
117
jv.syllable = (jv.consonant * jv.V) ^ -1
×
NEW
118
   * jv.consonant
×
NEW
119
   * ((jv.medial_ra ^ -1) * jv.medial_ya) ^ -1
×
NEW
120
   * (jv.M * jv.tarung ^ -1) ^ -1
×
NEW
121
   * jv.consonant_sign ^ 0
×
122

123
SILE.nodeMakers.jv = pl.class(SILE.nodeMakers.unicode)
×
124
function SILE.nodeMakers.jv:iterator (items)
×
NEW
125
   return coroutine.wrap(function ()
×
NEW
126
      local chunk = ""
×
NEW
127
      for i = 1, #items do
×
NEW
128
         local char = items[i].text
×
NEW
129
         chunk = chunk .. char
×
130
      end
NEW
131
      local i = 1
×
NEW
132
      local total = 0
×
NEW
133
      while total < #chunk do
×
NEW
134
         local syll = (lpeg.P(total) * lpeg.C(jv.syllable)):match(chunk)
×
NEW
135
         if syll then
×
NEW
136
            while i < #items do
×
NEW
137
               if items[i].index >= total + #syll then
×
138
                  break
139
               end
NEW
140
               self:addToken(items[i].text, items[i])
×
NEW
141
               i = i + 1
×
142
            end
NEW
143
            total = total + #syll
×
NEW
144
            self:makeToken()
×
NEW
145
            self:makePenalty(0)
×
146
         else
NEW
147
            self:dealWith(items[i])
×
NEW
148
            i = i + 1
×
NEW
149
            if i > #items then
×
150
               break
151
            end
NEW
152
            total = items[i].index
×
153
         end
154
      end
NEW
155
      self:makeToken()
×
156
   end)
157
end
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

© 2026 Coveralls, Inc