diff --git a/registry.rec b/registry.rec index a6f0f11f..bf2d273a 100644 --- a/registry.rec +++ b/registry.rec @@ -1,25 +1,6 @@ -# -*- mode: rec -*- -# -# Registry for Signature purposes -# -%rec: SignaturePurpose -%key: Number -%type: Number int -%mandatory: Number -%typedef: Name_t regexp /^[ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_][ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*$/ -%type: Name Name_t -%unique: Name -%mandatory: Name -%mandatory: Comment -%mandatory: Package -%allowed: Subsystem %sort: Number Name - -#----------------------------------------------------------------------------- -# GNUnet - Number: 0 Name: TEST Comment: Test signature, not valid for anything other than writing a test. (Note that the signature verification code will accept this value). diff --git a/tools/gen_signatures_registry.ml b/tools/gen_signatures_registry.ml index 07edac8f..9a7bf3d5 100644 --- a/tools/gen_signatures_registry.ml +++ b/tools/gen_signatures_registry.ml @@ -39,8 +39,10 @@ let field_value = take_till is_newline <* newline let field = lift3 (fun k () v -> { k; v }) field_name (char ':' *> blanks) field_value -let comments = many (char '#' *> take_till is_newline <* newline) -let line_sep = comments <* newline +let comment_line = char '#' *> take_till is_newline <* newline +(*>>| fun _s -> ()*) + +let line_sep = choice [ skip_many comment_line; (newline >>| fun _c -> ()) ] let record = sep_by1 line_sep field let recfile : record list t = many line_sep *> many record <* many line_sep let parse s = parse_string ~consume:All recfile s