diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-06-25 20:09:18 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-06-25 20:09:18 -0700 |
commit | 519afc33c5446fdd9abba34563ef839c924fb52e (patch) | |
tree | 0d416066d260ca5f346cc1dfaff057425b53891b /apache.txr | |
parent | a18be7b8a613125646ba8c7cdfa0309e96ff9412 (diff) | |
download | txrban-519afc33c5446fdd9abba34563ef839c924fb52e.tar.gz txrban-519afc33c5446fdd9abba34563ef839c924fb52e.tar.bz2 txrban-519afc33c5446fdd9abba34563ef839c924fb52e.zip |
Use if/elif/else syntax.
* apache.txr: Convert @(cases) with @(require) pattern to the
equivalent if/elif/else syntactic sugar.
Diffstat (limited to 'apache.txr')
-rw-r--r-- | apache.txr | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -4,16 +4,14 @@ @ (all) @ip - - [@(n day)/@(m month)/@(n year):@(n hour):@(n min):@(n sec) @nil] "@method @uri @proto/@ver" @err @bytes "@ref" "@agent" @ (and) -@ (cases) -@ (require (search-regex agent #/Googlebot|bingbot|baidu/)) +@ (if (search-regex agent #/Googlebot|bingbot|baidu/)) @ (bind points nil) -@ (or) -@ (require (search-regex agent #/Ezoom|[Bb][Oo][Tt]|[Ss]pider|[Cc]rawler|[Yy]andex|coccoc/)) +@ (elif (search-regex agent + #/Ezoom|[Bb][Oo][Tt]|[Ss]pider|[Cc]rawler|[Yy]andex|coccoc/)) @ (bind points 9) -@ (or) -@ (require (not (memqual err '("200" "301" "304")))) +@ (elif (not (memqual err '("200" "301" "304")))) @ (bind points 1) -@ (or) +@ (else) @ (bind points 0) @ (end) @ (end) |