lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Petite Abeille once stated:
> 
> On Sep 20, 2013, at 6:32 AM, Sean Conner <sean@conman.org> wrote:
> 
> >> [1] https://github.com/spc476/LPeg-Parsers/blob/master/email.lua
> 
> Very nice. Thanks for sharing.
> 
> One minor thing though: merge_addr can fail if there is no domain in an address:
> 
>   merge_addr = function(l,d)
>     return l .. "@" .. d
>   end,

  Actually, it doesn't fail because of the rule:

addr_spec       <- {:address: (local_part "@" domain) -> merge_addr :}

If there's no domain, the rule doesn't match, and thus, merge_addr() isn't
called.

  It does bring up another issue---I need to mention that the parser only
works with modern email (for instance, the Date: header now requires a
numeric value for the timezone instead of, say, "EST").  

  -spc