This commit is contained in:
parent
e8da5fde62
commit
645725f916
2 changed files with 4 additions and 21 deletions
19
registry.rec
19
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).
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue