Permalink
Browse files

entry_noindent_noeol maybe contain a semicolon

  • Loading branch information...
1 parent 17a7706 commit 648f7073f2841779ca990591a5d331e9c2ff6d6b @raphink raphink committed Nov 13, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 bacula.aug
View
@@ -34,6 +34,7 @@ module Bacula =
let keyvalue = key key_name . equal . val
let include = label "@include" . del "@" "@" . store /[^ #\t\n@};]+/
+ let semicolon = del /([ \t]*;)?/ ""
let eol = del /[ \t]*(;|(#[ \t]*)?\n)/ "\n"
let comment_or_eol = Util.comment_eol | eol
@@ -42,7 +43,7 @@ module Bacula =
let directive =
let entry = Util.empty | (indent . (line keyvalue|line include))
in let entry_noindent = line keyvalue|line include
- in let entry_noindent_noeol = [keyvalue] | [include]
+ in let entry_noindent_noeol = ([keyvalue] | [include]) . semicolon
in let entry_noeol = indent . entry_noindent_noeol
in [ key /[a-zA-Z]+/
. Build.block_generic
@@ -74,7 +75,7 @@ module Bacula =
test (Bacula.line keyvalue) get "Name = kaki-sd;" =
{"Name" = "kaki-sd"}
- test (Bacula.line include) get "@foobar;" =
+ test (Bacula.line include) get "@foobar ;" =
{"@include" = "foobar"}
test Bacula.lns get "Storage {\n Name = kaki-sd\n}\n" =
@@ -97,7 +98,7 @@ module Bacula =
(* semicolon *)
test Bacula.lns get "Storage {\n Name = kaki-sd;\n}\n" =
{"Storage"
- {"Name" = "kaki-sd" {} }
+ {"Name" = "kaki-sd" }
}
(* inline comment *)

0 comments on commit 648f707

Please sign in to comment.