{"action":"created","comment":{"url":"https://api.github.com/repos/coq/coq/pulls/comments/199348859","pull_request_review_id":133453536,"id":199348859,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTM0ODg1OQ==","diff_hunk":"@@ -687,13 +687,126 @@ side. E.g.:\n    Notation \"'apply_id' f a1 .. an\" := (.. (f a1) .. an)\n      (at level 10, f ident, a1, an at level 9).\n \n+Custom entries\n+~~~~~~~~~~~~~~\n+\n+.. cmd:: Declare Custom Entry @ident\n+\n+New term and pattern grammar entries, called *custom entries*, can be\n+declared using the :n:`Declare Custom Entry @ident` command and later\n+referred to using the entry name :n:`custom @ident`. For instance, we\n+may want to define an ad hoc parser for arithmetical operations and\n+proceed as follows:\n+\n+.. coqtop:: all\n+\n+   Inductive Expr :=\n+   | One : Expr\n+   | Mul : Expr -> Expr -> Expr\n+   | Add : Expr -> Expr -> Expr.\n+\n+   Declare Custom Entry expr.\n+   Notation \"[ e ]\" := e (e custom expr at level 2).\n+   Notation \"1\" := One (in custom expr at level 0).\n+   Notation \"x y\" := (Mul x y) (in custom expr at level 1, left associativity).\n+   Notation \"x + y\" := (Add x y) (in custom expr at level 2, left associativity).\n+   Notation \"( x )\" := x (in custom expr, x at level 2).\n+   Notation \"{ x }\" := x (in custom expr, x constr).\n+   Notation \"x\" := x (in custom expr at level 0, x ident).\n+\n+   Axiom f : nat -> Expr.\n+   Check fun x y z => [1 + y z + {f x}].\n+   Unset Printing Notations.\n+   Check fun x y z => [1 + y z + {f x}].\n+   Set Printing Notations.\n+   Check fun e => match e with\n+   | [1 + 1] => [1]\n+   | [x y + z] => [x + y z]\n+   | y => [y + e]\n+   end.\n+\n+Custom entries have levels, like the main grammar of terms and grammar\n+of patterns have. The lower level is 0 and this is the level used by\n+default to put rules delimited with tokens on both ends. The level is\n+left to be inferred by Coq when using :n:`in custom @ident``. The\n+level is otherwise given explicitly by using the syntax :n:`in custom\n+@ident at level @num`, where :n:`@num` refers to the level.\n+\n+Levels are cumulative: a notation at level ``n`` of which the left end","path":"doc/sphinx/user-extensions/syntax-extensions.rst","position":null,"original_position":94,"commit_id":"40c29f5ab42ada3d680436e0e6b947ba8a12685d","original_commit_id":"4a56fd12d39dbbb7cfe86edd49518a9a18d3ca1f","user":{"login":"Zimmi48","id":1108325,"node_id":"MDQ6VXNlcjExMDgzMjU=","avatar_url":"https://avatars2.githubusercontent.com/u/1108325?v=4","gravatar_id":"","url":"https://api.github.com/users/Zimmi48","html_url":"https://github.com/Zimmi48","followers_url":"https://api.github.com/users/Zimmi48/followers","following_url":"https://api.github.com/users/Zimmi48/following{/other_user}","gists_url":"https://api.github.com/users/Zimmi48/gists{/gist_id}","starred_url":"https://api.github.com/users/Zimmi48/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zimmi48/subscriptions","organizations_url":"https://api.github.com/users/Zimmi48/orgs","repos_url":"https://api.github.com/users/Zimmi48/repos","events_url":"https://api.github.com/users/Zimmi48/events{/privacy}","received_events_url":"https://api.github.com/users/Zimmi48/received_events","type":"User","site_admin":false},"body":"Yes, you would need to change it everywhere. I don't think it would look strange but as I said, it is a matter of taste.","created_at":"2018-07-01T13:01:46Z","updated_at":"2018-07-01T13:01:47Z","html_url":"https://github.com/coq/coq/pull/7923#discussion_r199348859","pull_request_url":"https://api.github.com/repos/coq/coq/pulls/7923","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/coq/coq/pulls/comments/199348859"},"html":{"href":"https://github.com/coq/coq/pull/7923#discussion_r199348859"},"pull_request":{"href":"https://api.github.com/repos/coq/coq/pulls/7923"}},"in_reply_to_id":199345840},"pull_request":{"url":"https://api.github.com/repos/coq/coq/pulls/7923","id":197339650,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MzM5NjUw","html_url":"https://github.com/coq/coq/pull/7923","diff_url":"https://github.com/coq/coq/pull/7923.diff","patch_url":"https://github.com/coq/coq/pull/7923.patch","issue_url":"https://api.github.com/repos/coq/coq/issues/7923","number":7923,"state":"open","locked":false,"title":"Documentation for custom entries","user":{"login":"herbelin","id":460771,"node_id":"MDQ6VXNlcjQ2MDc3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/460771?v=4","gravatar_id":"","url":"https://api.github.com/users/herbelin","html_url":"https://github.com/herbelin","followers_url":"https://api.github.com/users/herbelin/followers","following_url":"https://api.github.com/users/herbelin/following{/other_user}","gists_url":"https://api.github.com/users/herbelin/gists{/gist_id}","starred_url":"https://api.github.com/users/herbelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herbelin/subscriptions","organizations_url":"https://api.github.com/users/herbelin/orgs","repos_url":"https://api.github.com/users/herbelin/repos","events_url":"https://api.github.com/users/herbelin/events{/privacy}","received_events_url":"https://api.github.com/users/herbelin/received_events","type":"User","site_admin":false},"body":"**Kind:** documentation / fine-tuning\r\n\r\n~~This collects the part of #6247 which needs some more work (documentation + decide how involved the example of the documentation can be).~~ This extends #6247 with documentation, fixes and improved support for \"grammar coercions\".\r\n\r\n- [X] Documentation in reference manual\r\n- [X] Entry to be added in CHANGES\r\n- [X] Fine-tuning to make the example of the documentation working (parsing of parentheses, of identifiers, of rules without a symbol)\r\n- [ ] Feedback on documentation needed\r\n\r\nNote: This is on top of #6247.","created_at":"2018-06-26T08:23:07Z","updated_at":"2018-07-01T13:01:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd946ce7c03fd6aac41e4609168b5b289dbf3fe5","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mattam82","id":98373,"node_id":"MDQ6VXNlcjk4Mzcz","avatar_url":"https://avatars1.githubusercontent.com/u/98373?v=4","gravatar_id":"","url":"https://api.github.com/users/mattam82","html_url":"https://github.com/mattam82","followers_url":"https://api.github.com/users/mattam82/followers","following_url":"https://api.github.com/users/mattam82/following{/other_user}","gists_url":"https://api.github.com/users/mattam82/gists{/gist_id}","starred_url":"https://api.github.com/users/mattam82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattam82/subscriptions","organizations_url":"https://api.github.com/users/mattam82/orgs","repos_url":"https://api.github.com/users/mattam82/repos","events_url":"https://api.github.com/users/mattam82/events{/privacy}","received_events_url":"https://api.github.com/users/mattam82/received_events","type":"User","site_admin":false},{"login":"maximedenes","id":647105,"node_id":"MDQ6VXNlcjY0NzEwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/647105?v=4","gravatar_id":"","url":"https://api.github.com/users/maximedenes","html_url":"https://github.com/maximedenes","followers_url":"https://api.github.com/users/maximedenes/followers","following_url":"https://api.github.com/users/maximedenes/following{/other_user}","gists_url":"https://api.github.com/users/maximedenes/gists{/gist_id}","starred_url":"https://api.github.com/users/maximedenes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximedenes/subscriptions","organizations_url":"https://api.github.com/users/maximedenes/orgs","repos_url":"https://api.github.com/users/maximedenes/repos","events_url":"https://api.github.com/users/maximedenes/events{/privacy}","received_events_url":"https://api.github.com/users/maximedenes/received_events","type":"User","site_admin":false},{"login":"silene","id":1674458,"node_id":"MDQ6VXNlcjE2NzQ0NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1674458?v=4","gravatar_id":"","url":"https://api.github.com/users/silene","html_url":"https://github.com/silene","followers_url":"https://api.github.com/users/silene/followers","following_url":"https://api.github.com/users/silene/following{/other_user}","gists_url":"https://api.github.com/users/silene/gists{/gist_id}","starred_url":"https://api.github.com/users/silene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silene/subscriptions","organizations_url":"https://api.github.com/users/silene/orgs","repos_url":"https://api.github.com/users/silene/repos","events_url":"https://api.github.com/users/silene/events{/privacy}","received_events_url":"https://api.github.com/users/silene/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":762376854,"node_id":"MDU6TGFiZWw3NjIzNzY4NTQ=","url":"https://api.github.com/repos/coq/coq/labels/needs:%20merge%20of%20dependency","name":"needs: merge of dependency","color":"cc3b6b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/coq/coq/pulls/7923/commits","review_comments_url":"https://api.github.com/repos/coq/coq/pulls/7923/comments","review_comment_url":"https://api.github.com/repos/coq/coq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/coq/coq/issues/7923/comments","statuses_url":"https://api.github.com/repos/coq/coq/statuses/40c29f5ab42ada3d680436e0e6b947ba8a12685d","head":{"label":"herbelin:master+notation-custom-entry-doc","ref":"master+notation-custom-entry-doc","sha":"40c29f5ab42ada3d680436e0e6b947ba8a12685d","user":{"login":"herbelin","id":460771,"node_id":"MDQ6VXNlcjQ2MDc3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/460771?v=4","gravatar_id":"","url":"https://api.github.com/users/herbelin","html_url":"https://github.com/herbelin","followers_url":"https://api.github.com/users/herbelin/followers","following_url":"https://api.github.com/users/herbelin/following{/other_user}","gists_url":"https://api.github.com/users/herbelin/gists{/gist_id}","starred_url":"https://api.github.com/users/herbelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herbelin/subscriptions","organizations_url":"https://api.github.com/users/herbelin/orgs","repos_url":"https://api.github.com/users/herbelin/repos","events_url":"https://api.github.com/users/herbelin/events{/privacy}","received_events_url":"https://api.github.com/users/herbelin/received_events","type":"User","site_admin":false},"repo":{"id":38120719,"node_id":"MDEwOlJlcG9zaXRvcnkzODEyMDcxOQ==","name":"github-coq","full_name":"herbelin/github-coq","owner":{"login":"herbelin","id":460771,"node_id":"MDQ6VXNlcjQ2MDc3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/460771?v=4","gravatar_id":"","url":"https://api.github.com/users/herbelin","html_url":"https://github.com/herbelin","followers_url":"https://api.github.com/users/herbelin/followers","following_url":"https://api.github.com/users/herbelin/following{/other_user}","gists_url":"https://api.github.com/users/herbelin/gists{/gist_id}","starred_url":"https://api.github.com/users/herbelin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herbelin/subscriptions","organizations_url":"https://api.github.com/users/herbelin/orgs","repos_url":"https://api.github.com/users/herbelin/repos","events_url":"https://api.github.com/users/herbelin/events{/privacy}","received_events_url":"https://api.github.com/users/herbelin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/herbelin/github-coq","description":"Coq is a formal proof management system. It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs. ","fork":true,"url":"https://api.github.com/repos/herbelin/github-coq","forks_url":"https://api.github.com/repos/herbelin/github-coq/forks","keys_url":"https://api.github.com/repos/herbelin/github-coq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/herbelin/github-coq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/herbelin/github-coq/teams","hooks_url":"https://api.github.com/repos/herbelin/github-coq/hooks","issue_events_url":"https://api.github.com/repos/herbelin/github-coq/issues/events{/number}","events_url":"https://api.github.com/repos/herbelin/github-coq/events","assignees_url":"https://api.github.com/repos/herbelin/github-coq/assignees{/user}","branches_url":"https://api.github.com/repos/herbelin/github-coq/branches{/branch}","tags_url":"https://api.github.com/repos/herbelin/github-coq/tags","blobs_url":"https://api.github.com/repos/herbelin/github-coq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/herbelin/github-coq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/herbelin/github-coq/git/refs{/sha}","trees_url":"https://api.github.com/repos/herbelin/github-coq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/herbelin/github-coq/statuses/{sha}","languages_url":"https://api.github.com/repos/herbelin/github-coq/languages","stargazers_url":"https://api.github.com/repos/herbelin/github-coq/stargazers","contributors_url":"https://api.github.com/repos/herbelin/github-coq/contributors","subscribers_url":"https://api.github.com/repos/herbelin/github-coq/subscribers","subscription_url":"https://api.github.com/repos/herbelin/github-coq/subscription","commits_url":"https://api.github.com/repos/herbelin/github-coq/commits{/sha}","git_commits_url":"https://api.github.com/repos/herbelin/github-coq/git/commits{/sha}","comments_url":"https://api.github.com/repos/herbelin/github-coq/comments{/number}","issue_comment_url":"https://api.github.com/repos/herbelin/github-coq/issues/comments{/number}","contents_url":"https://api.github.com/repos/herbelin/github-coq/contents/{+path}","compare_url":"https://api.github.com/repos/herbelin/github-coq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/herbelin/github-coq/merges","archive_url":"https://api.github.com/repos/herbelin/github-coq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/herbelin/github-coq/downloads","issues_url":"https://api.github.com/repos/herbelin/github-coq/issues{/number}","pulls_url":"https://api.github.com/repos/herbelin/github-coq/pulls{/number}","milestones_url":"https://api.github.com/repos/herbelin/github-coq/milestones{/number}","notifications_url":"https://api.github.com/repos/herbelin/github-coq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/herbelin/github-coq/labels{/name}","releases_url":"https://api.github.com/repos/herbelin/github-coq/releases{/id}","deployments_url":"https://api.github.com/repos/herbelin/github-coq/deployments","created_at":"2015-06-26T16:13:10Z","updated_at":"2016-01-14T13:45:40Z","pushed_at":"2018-07-01T11:39:11Z","git_url":"git://github.com/herbelin/github-coq.git","ssh_url":"git@github.com:herbelin/github-coq.git","clone_url":"https://github.com/herbelin/github-coq.git","svn_url":"https://github.com/herbelin/github-coq","homepage":"http://coq.inria.fr/","size":101188,"stargazers_count":0,"watchers_count":0,"language":"OCaml","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"coq:master","ref":"master","sha":"033c32a32fedcf2160bb38a3fed55efa9d1c2b77","user":{"login":"coq","id":621198,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTE5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/621198?v=4","gravatar_id":"","url":"https://api.github.com/users/coq","html_url":"https://github.com/coq","followers_url":"https://api.github.com/users/coq/followers","following_url":"https://api.github.com/users/coq/following{/other_user}","gists_url":"https://api.github.com/users/coq/gists{/gist_id}","starred_url":"https://api.github.com/users/coq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coq/subscriptions","organizations_url":"https://api.github.com/users/coq/orgs","repos_url":"https://api.github.com/users/coq/repos","events_url":"https://api.github.com/users/coq/events{/privacy}","received_events_url":"https://api.github.com/users/coq/received_events","type":"Organization","site_admin":false},"repo":{"id":1377159,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc3MTU5","name":"coq","full_name":"coq/coq","owner":{"login":"coq","id":621198,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTE5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/621198?v=4","gravatar_id":"","url":"https://api.github.com/users/coq","html_url":"https://github.com/coq","followers_url":"https://api.github.com/users/coq/followers","following_url":"https://api.github.com/users/coq/following{/other_user}","gists_url":"https://api.github.com/users/coq/gists{/gist_id}","starred_url":"https://api.github.com/users/coq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coq/subscriptions","organizations_url":"https://api.github.com/users/coq/orgs","repos_url":"https://api.github.com/users/coq/repos","events_url":"https://api.github.com/users/coq/events{/privacy}","received_events_url":"https://api.github.com/users/coq/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/coq/coq","description":"Coq is a formal proof management system. It provides a formal language to write mathematical definitions, executable algorithms and theorems together with an environment for semi-interactive development of machine-checked proofs. ","fork":false,"url":"https://api.github.com/repos/coq/coq","forks_url":"https://api.github.com/repos/coq/coq/forks","keys_url":"https://api.github.com/repos/coq/coq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coq/coq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coq/coq/teams","hooks_url":"https://api.github.com/repos/coq/coq/hooks","issue_events_url":"https://api.github.com/repos/coq/coq/issues/events{/number}","events_url":"https://api.github.com/repos/coq/coq/events","assignees_url":"https://api.github.com/repos/coq/coq/assignees{/user}","branches_url":"https://api.github.com/repos/coq/coq/branches{/branch}","tags_url":"https://api.github.com/repos/coq/coq/tags","blobs_url":"https://api.github.com/repos/coq/coq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coq/coq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coq/coq/git/refs{/sha}","trees_url":"https://api.github.com/repos/coq/coq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coq/coq/statuses/{sha}","languages_url":"https://api.github.com/repos/coq/coq/languages","stargazers_url":"https://api.github.com/repos/coq/coq/stargazers","contributors_url":"https://api.github.com/repos/coq/coq/contributors","subscribers_url":"https://api.github.com/repos/coq/coq/subscribers","subscription_url":"https://api.github.com/repos/coq/coq/subscription","commits_url":"https://api.github.com/repos/coq/coq/commits{/sha}","git_commits_url":"https://api.github.com/repos/coq/coq/git/commits{/sha}","comments_url":"https://api.github.com/repos/coq/coq/comments{/number}","issue_comment_url":"https://api.github.com/repos/coq/coq/issues/comments{/number}","contents_url":"https://api.github.com/repos/coq/coq/contents/{+path}","compare_url":"https://api.github.com/repos/coq/coq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coq/coq/merges","archive_url":"https://api.github.com/repos/coq/coq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coq/coq/downloads","issues_url":"https://api.github.com/repos/coq/coq/issues{/number}","pulls_url":"https://api.github.com/repos/coq/coq/pulls{/number}","milestones_url":"https://api.github.com/repos/coq/coq/milestones{/number}","notifications_url":"https://api.github.com/repos/coq/coq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coq/coq/labels{/name}","releases_url":"https://api.github.com/repos/coq/coq/releases{/id}","deployments_url":"https://api.github.com/repos/coq/coq/deployments","created_at":"2011-02-17T05:49:37Z","updated_at":"2018-07-01T10:53:29Z","pushed_at":"2018-07-01T11:39:13Z","git_url":"git://github.com/coq/coq.git","ssh_url":"git@github.com:coq/coq.git","clone_url":"https://github.com/coq/coq.git","svn_url":"https://github.com/coq/coq","homepage":"https://coq.inria.fr/","size":112632,"stargazers_count":1305,"watchers_count":1305,"language":"OCaml","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":261,"mirror_url":null,"archived":false,"open_issues_count":1658,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":261,"open_issues":1658,"watchers":1305,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/coq/coq/pulls/7923"},"html":{"href":"https://github.com/coq/coq/pull/7923"},"issue":{"href":"https://api.github.com/repos/coq/coq/issues/7923"},"comments":{"href":"https://api.github.com/repos/coq/coq/issues/7923/comments"},"review_comments":{"href":"https://api.github.com/repos/coq/coq/pulls/7923/comments"},"review_comment":{"href":"https://api.github.com/repos/coq/coq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/coq/coq/pulls/7923/commits"},"statuses":{"href":"https://api.github.com/repos/coq/coq/statuses/40c29f5ab42ada3d680436e0e6b947ba8a12685d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Zimmi48"}}