{"action":"closed","issue":{"url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/issues/10","repository_url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main","labels_url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/issues/10/comments","events_url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/issues/10/events","html_url":"https://github.com/CS2103AUG2016-T11-C4/main/issues/10","id":181316077,"number":10,"title":"logic.parser: Define and implement a proper parsing algorithm","user":{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/labels/p.High","name":"p.High","color":"e15050"},{"url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/labels/t.Enhancement","name":"t.Enhancement","color":"E6E6E6"}],"state":"closed","locked":false,"assignee":{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false},"assignees":[{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/milestones/5","html_url":"https://github.com/CS2103AUG2016-T11-C4/main/milestones/v0.4","labels_url":"https://api.github.com/repos/CS2103AUG2016-T11-C4/main/milestones/5/labels","id":2080423,"number":5,"title":"v0.4","description":"","creator":{"login":"pyokagan","id":109479,"avatar_url":"https://avatars.githubusercontent.com/u/109479?v=3","gravatar_id":"","url":"https://api.github.com/users/pyokagan","html_url":"https://github.com/pyokagan","followers_url":"https://api.github.com/users/pyokagan/followers","following_url":"https://api.github.com/users/pyokagan/following{/other_user}","gists_url":"https://api.github.com/users/pyokagan/gists{/gist_id}","starred_url":"https://api.github.com/users/pyokagan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyokagan/subscriptions","organizations_url":"https://api.github.com/users/pyokagan/orgs","repos_url":"https://api.github.com/users/pyokagan/repos","events_url":"https://api.github.com/users/pyokagan/events{/privacy}","received_events_url":"https://api.github.com/users/pyokagan/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":12,"state":"open","created_at":"2016-10-19T16:38:42Z","updated_at":"2016-10-26T13:10:39Z","due_on":"2016-10-27T00:00:00Z","closed_at":null},"comments":3,"created_at":"2016-10-06T03:22:26Z","updated_at":"2016-10-26T13:10:39Z","closed_at":"2016-10-26T13:10:39Z","body":"Current commands are parsed using regular expressions. This does not provide a very good user experience because it does not allow for much flexibility in command formats. For instance, the parser expects a strict ordering of arguments.\r\n\r\nWe'll need to implement a proper parsing algorithm that can be easily explained and has a more flexible command format.\r\n\r\n## Requirements\r\n\r\n`ARG1 ARG2 ARG3 RESTARGS... <FLAG1>-<FLAGVALUE1> <FLAG2>-<FLAGVALUE2>...`\r\n\r\nWhitespace between `ARG1`, `ARG2`, `ARG3`...`ARGN` is not significant.\r\n\r\nWhitespace inside `RESTARGS` is significant.\r\n\r\nQuoting:\r\n* `\"` is used for quoting.\r\n\r\nFlags are specified by `<FLAGNAME>-<FLAG VALUE>`\r\n\r\n## Examples\r\n\r\n### Example 1\r\n\r\n```java\r\nArgumentParser parser = new ArgumentParser();\r\nparser.addArgument(\"arg1\").addArgument(\"arg2\").setRestArgsEnabled(true).addFlag(\"e\").addFlag(\"h\");\r\nSystem.out.println(parser.parse(\"a   b c   d e-f g h-i\"));\r\n```\r\n```\r\n{arg1: \"a\", arg2: \"b\", restArgs: \"c   d\", flags.e: \"f g\", flags.h: \"i\" }\r\n```\r\n\r\nNote that whitespace in `restArgs` is preserved. However, whitespace between `arg1` and `arg2` are not preserved.\r\n\r\n### Example 2: too many arguments\r\n```java\r\nArgumentParser parser = new ArgumentParser();\r\nparser.addArgument(\"arg1\").setRestArgsEnabled(false);\r\nSystem.out.println(parser.parse(\"a b\"));\r\n```\r\n```\r\nInvalidValueException: too many arguments\r\n```\r\n\r\n### Example 3: invalid flag\r\n```java\r\nArgumentParser parser = new ArgumentParser();\r\nparser.addArgument(\"arg1\").addFlag(\"g\");\r\nSystem.out.println(parser.parse(\"a e-f\"));\r\n```\r\n```\r\nInvalidValueException: invalid flag \"e\"\r\n```\r\n\r\n### Example 4: quoting"}}
{"actor":{"display_login":"pyokagan"}}