aboutsummaryrefslogtreecommitdiffstats
path: root/osurl
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2018-12-05 13:38:11 +0100
committerMatěj Cepl <mcepl@cepl.eu>2024-03-28 16:49:37 +0100
commit66983a5013b29d578accf5775b4973278527c603 (patch)
tree4f37cc2d54e425f644b0feaff668cd4a8cf55523 /osurl
parent1165cd3162a6e9849d5fc9461cb08ef9009b9f13 (diff)
downloadvim-suse-changes-66983a5013b29d578accf5775b4973278527c603.tar.gz
chore(osurl): TABs -> spaces
Diffstat (limited to 'osurl')
-rwxr-xr-xosurl38
1 files changed, 19 insertions, 19 deletions
diff --git a/osurl b/osurl
index e688de2..5d2dea8 100755
--- a/osurl
+++ b/osurl
@@ -4,37 +4,37 @@ local lpeg = require 'lpeg'
local P,C,Cs,Cf,R = lpeg.P, lpeg.C, lpeg.Cs, lpeg.Cf, lpeg.R
local tokens = {
- NONHASH = C((1 - P("#"))^1), -- any nonempty string not containing #
- NUM = C(R("09")^1), -- nonempty digit string
- WORD = C(R("AZ","az","09","__")^1) -- nonempty word
+ NONHASH = C((1 - P("#"))^1), -- any nonempty string not containing #
+ NUM = C(R("09")^1), -- nonempty digit string
+ WORD = C(R("AZ","az","09","__")^1) -- nonempty word
}
local patterns = {
- ["bgo#%NUM"] = "http://bugzilla.gnome.org/show_bug.cgi?id=%1",
- ["bko#%NUM"] = "http://bugzilla.kernel.org/show_bug.cgi?id=%1",
- ["bmo#%NUM"] = "http://bugzilla.mozilla.org/show_bug.cgi?id=%1",
- ["boo#%NUM"] = "http://bugzilla.opensuse.org/show_bug.cgi?id=%1",
- ["bsc#%NUM"] = "http://bugzilla.suse.com/show_bug.cgi?id=%1",
- ["gh#%NONHASH#%WORD"] = "https://github.com/%1/issues/%2",
- ["lp#%NUM"] = "https://launchpad.net/bugs/%1",
- ["rh#%NUM"] = "http://bugzilla.redhat.com/show_bug.cgi?id=%1"
+ ["bgo#%NUM"] = "http://bugzilla.gnome.org/show_bug.cgi?id=%1",
+ ["bko#%NUM"] = "http://bugzilla.kernel.org/show_bug.cgi?id=%1",
+ ["bmo#%NUM"] = "http://bugzilla.mozilla.org/show_bug.cgi?id=%1",
+ ["boo#%NUM"] = "http://bugzilla.opensuse.org/show_bug.cgi?id=%1",
+ ["bsc#%NUM"] = "http://bugzilla.suse.com/show_bug.cgi?id=%1",
+ ["gh#%NONHASH#%WORD"] = "https://github.com/%1/issues/%2",
+ ["lp#%NUM"] = "https://launchpad.net/bugs/%1",
+ ["rh#%NUM"] = "http://bugzilla.redhat.com/show_bug.cgi?id=%1"
}
-- turn "foo#%BLAH" into a pattern that matches everything literally except
-- %BLAH
local makepat = Cf(
- (
- ((P("%") * C(R("AZ")^1)) / tokens) -- %BLAH is from tokens
- + (P"%%" / function() return P"%" end) -- %% treat as literal %
- + (C(P(1)) / P) -- anything else is literal
- )^0,
- function(a,b) return a * b end)
+ (
+ ((P("%") * C(R("AZ")^1)) / tokens) -- %BLAH is from tokens
+ + (P"%%" / function() return P"%" end) -- %% treat as literal %
+ + (C(P(1)) / P) -- anything else is literal
+ )^0,
+ function(a,b) return a * b end)
local function make_pattern(str)
- return assert(makepat:match(str), "invalid pattern")
+ return assert(makepat:match(str), "invalid pattern")
end
local bugpat = P(false)
for k,v in pairs(patterns) do
- bugpat = bugpat + (make_pattern(k) / v)
+ bugpat = bugpat + (make_pattern(k) / v)
end
local pat = Cs((bugpat + P(1))^0)