{"action":"closed","issue":{"url":"https://api.github.com/repos/lark-parser/lark/issues/143","repository_url":"https://api.github.com/repos/lark-parser/lark","labels_url":"https://api.github.com/repos/lark-parser/lark/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/lark-parser/lark/issues/143/comments","events_url":"https://api.github.com/repos/lark-parser/lark/issues/143/events","html_url":"https://github.com/lark-parser/lark/issues/143","id":323321271,"number":143,"title":"Priority of Terminals Not Working","user":{"login":"GLaDOS1105","id":14951000,"avatar_url":"https://avatars2.githubusercontent.com/u/14951000?v=4","gravatar_id":"","url":"https://api.github.com/users/GLaDOS1105","html_url":"https://github.com/GLaDOS1105","followers_url":"https://api.github.com/users/GLaDOS1105/followers","following_url":"https://api.github.com/users/GLaDOS1105/following{/other_user}","gists_url":"https://api.github.com/users/GLaDOS1105/gists{/gist_id}","starred_url":"https://api.github.com/users/GLaDOS1105/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GLaDOS1105/subscriptions","organizations_url":"https://api.github.com/users/GLaDOS1105/orgs","repos_url":"https://api.github.com/users/GLaDOS1105/repos","events_url":"https://api.github.com/users/GLaDOS1105/events{/privacy}","received_events_url":"https://api.github.com/users/GLaDOS1105/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-15T17:55:06Z","updated_at":"2018-05-16T04:23:43Z","closed_at":"2018-05-16T04:23:43Z","author_association":"NONE","body":"I was trying to put some words as the reserved word in parsing codes. The example grammar I wrote is:\r\n``` g\r\n// test.g\r\n?program : stmt+\r\n\r\n?stmt: ID | MOD\r\n\r\nMOD.2 : \"mod\"\r\nID : LETTER (LETTER | DIGIT | \"-\")*\r\n\r\n%import common.LETTER\r\n%import common.DIGIT\r\n%import common.WS\r\n%ignore WS\r\n```\r\nThen I parsed the text `aa bb mod cc\\n` by following codes.\r\n\r\n``` python\r\nwith open('test.g') as f:\r\n    parser = Lark(f, start='program')\r\ntext = \"aa bb mod \\n\"\r\nprint(parser.parse(text))\r\n```\r\n\r\nHowever, I sometimes got\r\n\r\n``` python\r\nTree(program, [Token(ID, 'aa'), Token(ID, 'bb'), Token(ID, 'mod'), Token(ID, 'cc')])\r\n```\r\nwhich is unexpected.\r\nBut, sometimes I got (parse again)\r\n```\r\nTree(program, [Token(ID, 'aa'), Token(ID, 'bb'), Token(MOD, 'mod'), Token(ID, 'cc')])\r\n```\r\n\r\nIt seems the priority of `MOD.2` is not working properly. Or maybe there's another better way I don't know to filter out some reserved words from `ID`."}}
{"actor":{"display_login":"GLaDOS1105"}}