Permalink
Browse files

Support recursive blocks

  • Loading branch information...
1 parent c2a2068 commit 8ed99bcec5f87ef0596aee57be7f58454302439c @raphink raphink committed Nov 13, 2012
Showing with 14 additions and 8 deletions.
  1. +14 −8 bacula.aug
View
@@ -42,10 +42,10 @@ module Bacula =
let line (sto:lens) = [ sto . comment_or_eol ]
let line_noeol (sto:lens) = [ sto . comment_or_semicolon ]
- let block =
- let entry = Util.empty | (indent . (line keyvalue|line include))
- in let entry_noindent = line keyvalue | line include
- in let entry_noindent_noeol = line_noeol keyvalue | line_noeol include
+ let rec block =
+ let entry = Util.empty | (indent . (line keyvalue|line include|block))
+ in let entry_noindent = line keyvalue | line include | block
+ in let entry_noindent_noeol = line_noeol keyvalue | line_noeol include | block
in let entry_noeol = indent . entry_noindent_noeol
in [ label "@block" . store /[a-zA-Z]+/
. Build.block_generic
@@ -144,7 +144,12 @@ module Bacula =
{ "Name" = "kaki-sd" }
}
- test Bacula.lns get "FileSet { Include { signature = SHA1 } }" = ?
+ test Bacula.lns get "FileSet { Include { signature = SHA1 } }" =
+ { "@block" = "FileSet"
+ { "@block" = "Include"
+ { "signature" = "SHA1" }
+ }
+ }
test Bacula.lns get "FileSet {
Name = \"DefaultSet\"
@@ -156,13 +161,14 @@ module Bacula =
File = /etc
}
}" =
- {"FileSet"
+ {"@block" = "FileSet"
{"Name" = "DefaultSet"}
- {"Include"
- {"Options"
+ {"@block" = "Include"
+ {"@block" = "Options"
{"signature" = "SHA1"}
{"noatime" = "yes"}
}
+ { }
{"File" = "/etc"}
}
}

0 comments on commit 8ed99bc

Please sign in to comment.