Incomplete grammar, parses most of header at this point - incremental checkin peg-mime
authorKrista Grothoff <krista@pep-project.org>
Thu, 15 Sep 2016 11:16:13 +0200
branchpeg-mime
changeset 1175bc3d2a53ee85
parent 1153 eaf7b2eeea87
child 1176 020a639a2508
Incomplete grammar, parses most of header at this point - incremental checkin
mime-parser/mailmime.peg
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mime-parser/mailmime.peg	Thu Sep 15 11:16:13 2016 +0200
     1.3 @@ -0,0 +1,20 @@
     1.4 +Mail            <-      ( Header )+ NEWLINE ( Body )? EOF
     1.5 +Header          <-      HeaderKey COLON HeaderValue
     1.6 +HeaderKey       <-      ( Alpha / Digit / OrdinarySymbol )+
     1.7 +HeaderValue     <-      HeaderLine ( HeaderCont )*
     1.8 +HeaderLine      <-      Text* CRLF
     1.9 +HeaderCont      <-      Whitespace HeaderLine
    1.10 +Body            <-      PlainBody
    1.11 +PlainBody       <-      .* EOF
    1.12 +Text            <-      ( Alpha / Digit / Symbol / Space )+
    1.13 +Alpha           <-      [a-zA-Z]
    1.14 +Digit           <-      [0-9]
    1.15 +Symbol          <-      OrdinarySymbol / COLON
    1.16 +Whitespace      <-      Space+
    1.17 +Space           <-      [' ' '\t']
    1.18 +OrdinarySymbol  <-      ["!" "#" "$" "%" "&" "'" "*" "+" "\-" "/" "\" "=" "?" "^" "_" "`" "{" "|" "}" "~" "\[" "\]" "@" ";" "." "<" ">" "\"" "(" ")" ","]
    1.19 +COLON           <-      ':'
    1.20 +NEWLINE         <-      '\n'
    1.21 +CR              <-      '\r'
    1.22 +CRLF            <-      CR CR? NEWLINE 
    1.23 +EOF             <-      !.
    1.24 \ No newline at end of file