Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email grammar too complex (Lpeg 0.12) #2

Closed
daurnimator opened this issue Sep 3, 2013 · 9 comments
Closed

Email grammar too complex (Lpeg 0.12) #2

daurnimator opened this issue Sep 3, 2013 · 9 comments
Assignees

Comments

@daurnimator
Copy link

After filing Issue #1 I upgraded my lpeg:

$ lua -l lpeg -e "print(lpeg.version())"
0.12

Now I get an entirely different error :)

$ lua ../LPeg-Parsers/email.lua
lua: bad argument #1 to '?' (grammar has too many rules)
stack traceback:
        [C]: ?
        [C]: in function 'match'
        /usr/local/share/lua/5.1/re.lua:208: in function </usr/local/share/lua/5.1/re.lua:206>
        (tail call): ?
        [C]: ?
@spc476
Copy link
Owner

spc476 commented Sep 3, 2013

The code here was developed under LPeg 10.2. I haven't tried with anything newer.

@ghost ghost assigned spc476 Sep 3, 2013
@daurnimator
Copy link
Author

I might send something to lua-l then?

@spc476
Copy link
Owner

spc476 commented Sep 3, 2013

It was thus said that the Great daurnimator once stated:

I might send something to lua-l then?

I was planning on doing the same thing. I just wanted to double check
that it ran under LPeg 0.10 (which it does).

@spc476
Copy link
Owner

spc476 commented Sep 3, 2013

Ah, I see you got there first. Thanks.

@spc476
Copy link
Owner

spc476 commented Sep 3, 2013

It's a limitation with LPeg 0.12. I'm closing the issue as it's now in the hands of the LPeg developers.

@spc476 spc476 closed this as completed Sep 3, 2013
@daurnimator
Copy link
Author

All good :)

@aklt
Copy link

aklt commented Jan 12, 2017

I ran into what I think is the same or at least a similar issue and
would like to use this parser, so consider this a note.

# lua -v
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
# lua -l lpeg -e "print(lpeg.version())"
1.0.0

If I run

print(inspect(email:match(myEmail)))

on the email in the example it causes a core dump on my machine and gdb shows that there
is a huge stack from somewhere in lpeg.so.

A simmilar bug is described here, but not fixed in lpeg 1.0.0:

http://lua-users.org/lists/lua-l/2016-09/msg00155.html

http://lua-users.org/lists/lua-l/2016-09/msg00189.html

@spc476
Copy link
Owner

spc476 commented Jan 22, 2017

It works with LPeg 1.0.1. I've updated the rockspec so if you use LuaRocks, it should be an easy to reinstall both.

@aklt
Copy link

aklt commented Jan 22, 2017

Cool, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants