return
end
+ -- Unbalanced if/endif
+ if if_nested < 0 then if_nested = 0 end
if skip_to_endif then
if string.match(l, '^endif') then
if_nested = if_nested - 1
end
elseif string.match(l, '^if') then
if_nested = if_nested + 1
+ elseif string.match(l, '^else') then
+ -- Else counterpart for if
+ skip_to_endif = false
end
return
else
return false
end, known_plugins) then
skip_to_endif = true
- if_nested = 1
end
+ if_nested = if_nested + 1
elseif string.match(l, '^if !plugin%(') then
local pname = string.match(l, '^if !plugin%(([A-Za-z:]+)%)')
if fun.any(function(pl)
return false
end, known_plugins) then
skip_to_endif = true
- if_nested = 1
end
+ if_nested = if_nested + 1
elseif string.match(l, '^if') then
-- Unknown if
skip_to_endif = true
- if_nested = 1
+ if_nested = if_nested + 1
+ elseif string.match(l, '^else') then
+ -- Else counterpart for if
+ skip_to_endif = true
+ elseif string.match(l, '^endif') then
+ if_nested = if_nested - 1
end
end
cur_rule['type'] = 'meta'
cur_rule['symbol'] = words[2]
cur_rule['meta'] = words_to_re(words, 2)
- if cur_rule['meta'] and cur_rule['symbol'] then valid_rule = true end
+ if cur_rule['meta'] and cur_rule['symbol']
+ and cur_rule['meta'] ~= '0' then
+ valid_rule = true
+ end
elseif words[1] == "describe" and valid_rule then
cur_rule['description'] = words_to_re(words, 2)
elseif words[1] == "score" then