/***/

//

//                         ; " (Double Quote)

//                         ; Internet standard newline

//                         ; carriage return

//                         ; horizontal tab

//                         ; linefeed

//                         ; visible (printing) characters

//                         ; white space

//                       "!" / "#" /        ;  characters not including

//                       "$" / "%" /        ;  specials.  Used for atoms.

//                       "&" / "'" /

//                       "*" / "+" /

//                       "-" / "/" /

//                       "=" / "?" /

//                       "^" / "_" /

//                       "`" / "{" /

//                       "|" / "}" /

//                       "~"

//                       *("," [CFWS] ["@" domain])

//                       obs-angle-addr

//                      %d11 /             ;  characters that do not

//                      %d12 /             ;  include the carriage

//                      %d127              ;  white space characters

//                      %d14-31 /          ;  return, line feed, and

//                      %d35-91 /          ;  characters not including

//                      %d93-126 /         ;  "\" or the quote character

//                      %d94-126 /         ;  characters not including

//                      DQUOTE *([FWS] qcontent) [FWS] DQUOTE

//                      [CFWS]

//                      obs-dtext          ;  "[", "]", or "\"

//                      obs-qtext

//                     %d42-91 /          ;  characters not including

//                     %d93-126 /         ;  "(", ")", or "\"

//                     obs-ctext

//            address: <addr-spec>,

//            domain: <domain>

//            local: <local-part>,

//            name: <display-name>,

//            node: <node in ast for this address>,

//         }, ...]

//     addresses: [{

//     ast: <an abstract syntax tree based on rfc5322>,

//   address         =   mailbox / group

//   address-list    =   (address *("," address)) / obs-addr-list

//   angle-addr      =   [CFWS] "<" addr-spec ">" [CFWS] /

//   display-name    =   phrase

//   group           =   display-name ":" [group-list] ";" [CFWS]

//   group-list      =   mailbox-list / CFWS / obs-group-list

//   mailbox         =   name-addr / addr-spec

//   mailbox-list    =   (mailbox *("," mailbox)) / obs-mbox-list

//   name-addr       =   [display-name] angle-addr

//   obs-domain-list =   *(CFWS / ",") "@" domain

//  dtext           =   %d33-90 /          ; Printable US-ASCII

//  obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control

//  qtext           =   %d33 /             ; Printable US-ASCII

//  quoted-string   =   [CFWS]

// "  First  Last " -> "First Last"

// "First   Last" -> "First Last"

// "First Last" -> "First Last"

// 'group'

// 'mailbox'

// 3.2.1. Quoted characters

// 3.2.2. Folding White Space and Comments

// 3.2.3. Atom

// 3.2.4. Quoted Strings

// 3.2.5 Miscellaneous Tokens

// 3.4. Address Specification

// 3.4.1 Addr-Spec Specification

// 3.6.2 Originator Fields

// 4.1. Miscellaneous Obsolete Tokens

// 4.2. Obsolete Folding White Space

// 4.4. Obsolete Addressing

// An address is a 'group' (i.e. a list of mailboxes) or a 'mailbox'.

// B.1. Core Rules

// Below we only parse the field body, not the name of the field

// CFWS            =   (1*([FWS] comment) [FWS]) / FWS

// CR             =  %x0D

// CRLF           =  CR LF

// DQUOTE         =  %x22

// FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FWS

// For reference, the extended RFC 5322 productions are:

// HTAB           =  %x09

// In JavaScript, we just deal directly with Unicode code points,

// Just check that the character is non-ascii.

// LF             =  %x0A

// Many thanks to Dominic Sayers and his documentation on the is_email function,

// NOTE: read the errata http://www.rfc-editor.org/errata_search.php?rfc=5322&eid=1908

// One expects names to get normalized like this:

// RFC 6532 extends RFC 5322 productions to include UTF-8

// RFC 6854 2.1. Replacement of RFC 5322, Section 3.6.2. Originator Fields

// SP             =  %x20

// This library does not validate email addresses.

// UTF-8 pseudo-production (RFC 6532)

// UTF8-2          =   <Defined in Section 4 of RFC3629>

// UTF8-3          =   <Defined in Section 4 of RFC3629>

// UTF8-4          =   <Defined in Section 4 of RFC3629>

// UTF8-non-ascii  =   UTF8-2 / UTF8-3 / UTF8-4

// VCHAR          =  %x21-7E

// VCHAR   =/  UTF8-non-ascii

// WSP            =  SP / HTAB

// a quoted pair will be two characters, and the "\" character

// addr-spec       =   local-part "@" domain

// ast analysis

// atext   =/  UTF8-non-ascii

// atom            =   [CFWS] 1*atext [CFWS]

// ccontent        =   ctext / quoted-pair / comment

// comment         =   "(" *([FWS] ccontent) [FWS] ")"

// common productions (RFC 5234)

// ctext           =   %d33-39 /          ; Printable US-ASCII

// ctext   =/  UTF8-non-ascii

// domain          =   dot-atom / domain-literal / obs-domain

// domain-literal  =   [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]

// don't look at children (hence findAllNodesNoChildren)

// dot-atom        =   [CFWS] dot-atom-text [CFWS]

// dot-atom-text   =   1*atext *("." 1*atext)

// dtext   =/  UTF8-non-ascii

// email productions (RFC 5322)

// email-addresses returns {

// email-addresses.js - RFC 5322 email address parser

// emailAddresses attempts to parse addresses using the (fairly liberal)

// emailAddresses.parseOneAddress and emailAddresses.parseAddressList

// for the "RFC 5322" part.

// from = "From:" (mailbox-list / address-list) CRLF

// grammar specified in RFC 5322.

// http://code.google.com/p/isemail/ , which helped greatly in writing this parser.

// http://tools.ietf.org/html/rfc5234

// http://tools.ietf.org/html/rfc5322

// like "From:", "Sender:", or "Reply-To:". Other libraries that

// local-part      =   dot-atom / quoted-string / obs-local-part

// note: quoted-string, dotAtom are proper subsets of obs-local-part

// obs-FWS         =   1*([CRLF] WSP)

// obs-addr-list   =   *([CFWS] ",") address *("," [address / CFWS])

// obs-angle-addr  =   [CFWS] "<" obs-route addr-spec ">" [CFWS]

// obs-ctext       =   obs-NO-WS-CTL

// obs-domain       = atom *("." atom)

// obs-dtext       =   obs-NO-WS-CTL / quoted-pair

// obs-group-list  =   1*([CFWS] ",") [CFWS]

// obs-local-part = word *("." word)

// obs-mbox-list   =   *([CFWS] ",") mailbox *("," [mailbox / CFWS])

// obs-phrase      =   word *(word / "." / CFWS)

// obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)

// obs-qtext       =   obs-NO-WS-CTL

// obs-route       =   obs-domain-list ":"

// parse email headers can parse those and defer to these productions

// parser helper functions

// phrase          =   1*word / obs-phrase

// qcontent        =   qtext / quoted-pair

// qtext   =/  UTF8-non-ascii

// quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp

// reply-to = "Reply-To:" address-list CRLF

// sender = "Sender:" (mailbox / address) CRLF

// should be semantically "invisible" (RFC 5322 3.2.1)

// so we aren't checking individual bytes for UTF-8 encoding.

// so we really just have to look for obsLocalPart, if we don't care about the exact parse tree

// strip all whitespace from domains

// tokenizing functions

// using the following productions:

// v 5.0.0

// word            =   atom / quoted-string

// work as you might expect. Try it out.

// }

/////////////////////////////////////////////////////

//atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
