Content deleted Content added
m Simplified code, primarily by eliminating a few sources of redundancy Tag: Reverted |
Undid revision 1147915801 by Lemondoge (talk): oh dear. I checked with testcases - don't know how this goofed |
||
Line 79:
hitCount = 0
sWordlist = tArgs.sep .. sWordlist .. tArgs.sep
local eSep
eSep = escape_word(tArgs.sep) local patstring = '%f[^' .. eSep .. '][^' .. eSep .. ']+%f[' .. eSep .. ']'
if yesno(tArgs.explain, false) then
Line 141 ⟶ 142:
-- note 2: empty AND-wordlist => True by logic (because: not falsified)
local function checkANDwords(sourceWordTable, andWordTable)
bAND = true
tHits = {}
result1 = nil
if #andWordTable > 0 then
for i, word in ipairs(andWordTable) do
Line 156 ⟶ 160:
end
end
else
bAND = true
end
Line 168 ⟶ 174:
-- note 2: while just one hitword is a True result, the hittable contains all words found
local function checkORwords(sourceWordTable, orWordTable)
bOR = false
tHits = {}
result1 = nil
if #orWordTable > 0 then
for i, word in ipairs(orWordTable) do
Line 199 ⟶ 208:
return tArgs.no or ''
else -- True
return sYeslist
else -- some |yes= value is entered, could be ''
return tArgs.yes
end
end
end
Line 272 ⟶ 285:
if yesno(tArgs.explain, false) then
if tArgs.yes ~= nil then
if (tArgs.yes == '') and (tArgs.no == '') then report.xpYesNoBothBlank()
end
end
if warningIMaxWordsReached ~= nil then
Line 350 ⟶ 365:
sReturn = p._main(tArgs)
if warningIMaxWordsReached ~=
local preview = require('Module:If preview')
sReturn = sReturn .. preview._warning({warningIMaxWordsReached})
|