{"action":"created","issue":{"url":"https://api.github.com/repos/ronsavage/MarpaX-Languages-Lua-Parser/issues/3","labels_url":"https://api.github.com/repos/ronsavage/MarpaX-Languages-Lua-Parser/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/ronsavage/MarpaX-Languages-Lua-Parser/issues/3/comments","events_url":"https://api.github.com/repos/ronsavage/MarpaX-Languages-Lua-Parser/issues/3/events","html_url":"https://github.com/ronsavage/MarpaX-Languages-Lua-Parser/issues/3","id":98616805,"number":3,"title":"ambiguity in constructs.lua","user":{"login":"rns","id":366934,"avatar_url":"https://avatars.githubusercontent.com/u/366934?v=3","gravatar_id":"","url":"https://api.github.com/users/rns","html_url":"https://github.com/rns","followers_url":"https://api.github.com/users/rns/followers","following_url":"https://api.github.com/users/rns/following{/other_user}","gists_url":"https://api.github.com/users/rns/gists{/gist_id}","starred_url":"https://api.github.com/users/rns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rns/subscriptions","organizations_url":"https://api.github.com/users/rns/orgs","repos_url":"https://api.github.com/users/rns/repos","events_url":"https://api.github.com/users/rns/events{/privacy}","received_events_url":"https://api.github.com/users/rns/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-02T15:28:16Z","updated_at":"2015-08-02T17:49:46Z","closed_at":null,"body":"```\r\nThe Lua source is ambiguous: Length of symbol \"<stat item>\" at line 153, column 1 is ambiguous\r\n  Choices start with: f,a = loadstring\r\n  Choice 1, length=16, ends at line 153, column 16\r\n  Choice 1: f,a = loadstring\r\n  Choice 2, length=22, ends at line 153, column 22\r\n  Choice 2: f,a = loadstring(f)();\r\n```\r\n\r\nrules involved:\r\n```\r\n<stat item> ::= <stat>\r\n...\r\n<stat> ::= <functioncall>\r\n...\r\n<exp> ::=\r\n\t\t<var>\r\n\t | '(' <exp> ')' assoc => group\r\n\t|| <exp> <args> assoc => right\r\n\t|| <exp> ':' <Name> <args> assoc => right\r\n...\r\n<prefixexp> ::= <var>\r\n<prefixexp> ::= <functioncall>\r\n<prefixexp> ::= '(' <exp> ')'\r\n\r\n<functioncall> ::= <prefixexp> <args>\r\n<functioncall> ::= <prefixexp> ':' <Name> <args>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ronsavage/MarpaX-Languages-Lua-Parser/issues/comments/127050483","html_url":"https://github.com/ronsavage/MarpaX-Languages-Lua-Parser/issues/3#issuecomment-127050483","issue_url":"https://api.github.com/repos/ronsavage/MarpaX-Languages-Lua-Parser/issues/3","id":127050483,"user":{"login":"rns","id":366934,"avatar_url":"https://avatars.githubusercontent.com/u/366934?v=3","gravatar_id":"","url":"https://api.github.com/users/rns","html_url":"https://github.com/rns","followers_url":"https://api.github.com/users/rns/followers","following_url":"https://api.github.com/users/rns/following{/other_user}","gists_url":"https://api.github.com/users/rns/gists{/gist_id}","starred_url":"https://api.github.com/users/rns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rns/subscriptions","organizations_url":"https://api.github.com/users/rns/orgs","repos_url":"https://api.github.com/users/rns/repos","events_url":"https://api.github.com/users/rns/events{/privacy}","received_events_url":"https://api.github.com/users/rns/received_events","type":"User","site_admin":false},"created_at":"2015-08-02T17:49:46Z","updated_at":"2015-08-02T17:49:46Z","body":"@jeffreykegler -- ok, done in the patch below; what do you think -- can it be done in bnf?\r\n\r\n@ronsavage -- would you like to try it to see how it works with your parse tree processing code? There can be deep recursion warning in traversal, can be silenced with\r\n```perl\r\nmy $DOWARN = 1;\r\nBEGIN { $SIG{'__WARN__'} = sub { warn $_[0] if $DOWARN } }\r\n...\r\n$DOWARN = 0;\r\n        # parse tree traversal code ...\r\n$DOWARN = 1;\r\n```\r\nthe patch\r\n```\r\n--- a/lib/MarpaX/Languages/Lua/Parser.pm\r\n+++ b/lib/MarpaX/Languages/Lua/Parser.pm\r\n@@ -749,21 +749,23 @@ lexeme default = latm => 1 action => [name,values]\r\n # Names which begin with \"Lua\" are taken directly from\r\n # the Lua reference manual grammar.\r\n\r\n-<chunk> ::= <stat list> <optional laststat>\r\n-\r\n-<stat list> ::= <stat item>*\r\n-<stat item> ::= <stat> ';'\r\n-<stat item> ::= <stat>\r\n-\r\n-<optional laststat> ::= <laststat> ';'\r\n-<optional laststat> ::= <laststat>\r\n-<optional laststat> ::=\r\n+<chunk> ::=\r\n+<chunk> ::= <stat list>\r\n+<chunk> ::= <stat list> laststat\r\n+<chunk> ::= <stat list> laststat ';'\r\n+<chunk> ::= laststat ';'\r\n+<chunk> ::= laststat\r\n+\r\n+<stat list> ::= <stat>\r\n+<stat list> ::= <stat> ';'\r\n+<stat list> ::= <stat list> <stat> rank => -1\r\n+<stat list> ::= <stat list> <stat> ';'\r\n\r\n <block> ::= <chunk>\r\n\r\n <stat> ::= <varlist> '=' <explist>\r\n\r\n-<stat> ::= <functioncall>\r\n+<stat> ::= <functioncall> rank => -1\r\n\r\n <stat> ::= <keyword do> <block> <keyword end>\r\n```"}}