Skip to content

Commit 85e5bba

Browse files
committed
/0 is the same as function() end but better
1 parent 0da7cad commit 85e5bba

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lpeg_patterns/email.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ local comment = P {
3434
ccontent = ctext + quoted_pair + V"comment" ;
3535
comment = P"("* (FWS^-1 * V"ccontent")^0 * FWS^-1 * P")";
3636
}
37-
local CFWS = ((FWS^-1 * comment)^1 * FWS^-1 + FWS ) / function() end
37+
local CFWS = ((FWS^-1 * comment)^1 * FWS^-1 + FWS ) / 0
3838

3939
-- Atom
4040
local specials = S[=[()<>@,;:\".[]]=]

lpeg_patterns/http/origin.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ local C = lpeg.C
99
local P = lpeg.P
1010

1111
-- discard captures from scheme, host, port and just get whole string
12-
local serialized_origin = C(uri.scheme * P"://" * uri.host * (P":" * uri.port)^-1/function() end)
12+
local serialized_origin = C(uri.scheme * P"://" * uri.host * (P":" * uri.port)^-1/0)
1313
local origin_list = serialized_origin * (core.SP * serialized_origin)^0
1414
local origin_list_or_null = P"null" + origin_list
1515
local Origin = http_core.OWS * origin_list_or_null * http_core.OWS

lpeg_patterns/language.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ local irregular = P"en-GB-oed"
7777

7878
M.Language_Tag = C((M.langtag
7979
+ M.privateuse
80-
+ irregular) / function() end) -- capture the whole tag. throws away decomposition
80+
+ irregular) / 0) -- capture the whole tag. throws away decomposition
8181

8282
return M

0 commit comments

Comments
 (0)