[augeas-devel] augeas: master - Squid: allow indentation of entries

David Lutterkort lutter at fedoraproject.org
Wed Apr 8 19:54:55 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=3b0d8f588ae757767ca465e0ca599e198cd234e3
Commit:        3b0d8f588ae757767ca465e0ca599e198cd234e3
Parent:        591918ea1bc542ea552271e0939af0ea121af1d1
Author:        Raphael Pinson <raphink at gmail.com>
AuthorDate:    Wed Apr 8 12:14:21 2009 -0700
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Wed Apr 8 12:14:21 2009 -0700

Squid: allow indentation of entries

---
 lenses/squid.aug            |   12 ++++++++----
 lenses/tests/test_squid.aug |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/lenses/squid.aug b/lenses/squid.aug
index a4cad96..16796ec 100644
--- a/lenses/squid.aug
+++ b/lenses/squid.aug
@@ -14,6 +14,7 @@ module Squid =
 
 let eol         = Util.eol
 let spc         = Util.del_ws_spc
+let indent      = Util.indent
 
 let word        =  /[A-Za-z0-9!_.-]+(\[[0-9]+\])?/
 let sto_to_spc  = store /[^# \t\n]+/
@@ -341,14 +342,15 @@ let entry_re =    "accept_filter"
                 | "zph_option"
                 | "zph_parent"
                 | "zph_sibling"
-let entry       = Spacevars.entry entry_re
+let entry       = indent . Spacevars.entry entry_re
 
 (************************************************************************
  *                                AUTH
  *************************************************************************)
 
 let auth_re     = "auth_param"
-let auth        = [ key "auth_param"
+let auth        = indent
+                  . [ key "auth_param"
                   . value "scheme"
                   . value "parameter"
                   . (value "setting") ?
@@ -359,7 +361,8 @@ let auth        = [ key "auth_param"
  *************************************************************************)
 
 let acl_re     = "acl"
-let acl        = [ key acl_re . spc
+let acl        = indent
+                 . [ key acl_re . spc
                  . [ key word
                    . value "type"
                    . value "setting"
@@ -373,7 +376,8 @@ let acl        = [ key acl_re . spc
 let http_access_re
                = "http_access"
 let http_access
-               = [ key http_access_re
+               = indent
+                 . [ key http_access_re
                  . spc
                  . [ key /allow|deny/
                    . spc
diff --git a/lenses/tests/test_squid.aug b/lenses/tests/test_squid.aug
index 019b3c8..0391e0a 100644
--- a/lenses/tests/test_squid.aug
+++ b/lenses/tests/test_squid.aug
@@ -6,7 +6,7 @@ auth_param negotiate children 5
 acl many_spaces rep_header Content-Disposition -i [[:space:]]{3,}
 acl CONNECT method CONNECT
 # comment in the middle
-acl local_network src 192.168.1.0/24
+  acl local_network src 192.168.1.0/24
 
 http_access allow manager localhost
 http_access allow local_network




More information about the augeas-devel mailing list