Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add top-level statements

  • Loading branch information...
commit 2a3f3724a31aa369550915cd73f83f915adf5343 1 parent a137a83
@raphink raphink authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 bacula.aug
View
10 bacula.aug
@@ -32,7 +32,7 @@ module Bacula =
let val = dquote . store /[^}"#\n\t; ][^}"#\n;]*[^}"#\n\t; ]/ . dquote
let keyvalue = key key_name . equal . val
- let include = label "@include" . Util.del_str "@" . store /[^ #\t\n@};]+/
+ let include = label "@include" . Util.del_str "@" . store /[^# \t\n@};]+/
let semicolon = del /([ \t]*;)?/ ""
let eol = del /[ \t]*(;|(#[ \t]*)?\n)/ "\n"
@@ -61,7 +61,9 @@ module Bacula =
Build.block_rdelim_default (* rdelim_default *)
]
- let lns = ((Util.indent . block)|Util.empty|Util.comment)*
+ let statement = Util.indent . (line keyvalue | line include | block)
+
+ let lns = (statement|Util.empty|Util.comment)*
let filter = incl "/etc/bacula/*.conf"
. Util.stdexcl
@@ -73,8 +75,8 @@ module Bacula =
test (Bacula.line keyvalue) get "Name = kaki-sd\n" =
{"Name" = "kaki-sd"}
- test (Bacula.line include) get "@foobar\n" =
- {"@include" = "foobar"}
+ test (Bacula.line include) get "@/etc/foo.conf\n" =
+ {"@include" = "/etc/foo.conf"}
test (Bacula.line keyvalue) get "Name = kaki-sd;" =
{"Name" = "kaki-sd"}
Please sign in to comment.
Something went wrong with that request. Please try again.