{"action":"created","comment":{"url":"https://api.github.com/repos/cdglabs/ohm/pulls/comments/65058534","id":65058534,"diff_hunk":"@@ -146,52 +146,70 @@ Grammar.prototype = {\n       throw new Error(\n           'Why would anyone want to generate a recipe for the ' + this.name + ' grammar?!?!');\n     }\n-    var sb = new common.StringBuffer();\n-    if (optVarName) {\n-      sb.append('var ' + optVarName + ' = ');\n-    }\n-    sb.append('(function() {\\n');\n \n-    // Include the supergrammar in the recipe if it's not a built-in grammar.\n-    var superGrammarDecl = '';\n-    if (!this.superGrammar.isBuiltIn()) {\n-      sb.append(this.superGrammar.toRecipe('buildSuperGrammar'));\n-      superGrammarDecl = '    .withSuperGrammar(buildSuperGrammar.call(this))\\n';\n-    }\n-    sb.append('  var decl = this.newGrammar(' + JSON.stringify(this.name) + ')\\n');\n+    var recipe = [\n+      'grammar',\n+      {}, // meta-info","path":"src/Grammar.js","position":19,"original_position":19,"commit_id":"5cc1f6794f92a9788816bcc9efed78c86e84497f","original_commit_id":"5cc1f6794f92a9788816bcc9efed78c86e84497f","user":{"login":"pdubroy","id":17293,"avatar_url":"https://avatars.githubusercontent.com/u/17293?v=3","gravatar_id":"","url":"https://api.github.com/users/pdubroy","html_url":"https://github.com/pdubroy","followers_url":"https://api.github.com/users/pdubroy/followers","following_url":"https://api.github.com/users/pdubroy/following{/other_user}","gists_url":"https://api.github.com/users/pdubroy/gists{/gist_id}","starred_url":"https://api.github.com/users/pdubroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdubroy/subscriptions","organizations_url":"https://api.github.com/users/pdubroy/orgs","repos_url":"https://api.github.com/users/pdubroy/repos","events_url":"https://api.github.com/users/pdubroy/events{/privacy}","received_events_url":"https://api.github.com/users/pdubroy/received_events","type":"User","site_admin":false},"body":"I'd stick this in a var named `metaInfo`, then you can eliminate the comment, and the code below that uses `recipe[1]` will be a bit more self-documenting.","created_at":"2016-05-30T11:20:36Z","updated_at":"2016-05-30T11:20:36Z","html_url":"https://github.com/cdglabs/ohm/pull/109#discussion_r65058534","pull_request_url":"https://api.github.com/repos/cdglabs/ohm/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/cdglabs/ohm/pulls/comments/65058534"},"html":{"href":"https://github.com/cdglabs/ohm/pull/109#discussion_r65058534"},"pull_request":{"href":"https://api.github.com/repos/cdglabs/ohm/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/cdglabs/ohm/pulls/109","id":71446911,"html_url":"https://github.com/cdglabs/ohm/pull/109","diff_url":"https://github.com/cdglabs/ohm/pull/109.diff","patch_url":"https://github.com/cdglabs/ohm/pull/109.patch","issue_url":"https://api.github.com/repos/cdglabs/ohm/issues/109","number":109,"state":"open","locked":false,"title":"JSON recipes for grammars","user":{"login":"mroeder","id":160313,"avatar_url":"https://avatars.githubusercontent.com/u/160313?v=3","gravatar_id":"","url":"https://api.github.com/users/mroeder","html_url":"https://github.com/mroeder","followers_url":"https://api.github.com/users/mroeder/followers","following_url":"https://api.github.com/users/mroeder/following{/other_user}","gists_url":"https://api.github.com/users/mroeder/gists{/gist_id}","starred_url":"https://api.github.com/users/mroeder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mroeder/subscriptions","organizations_url":"https://api.github.com/users/mroeder/orgs","repos_url":"https://api.github.com/users/mroeder/repos","events_url":"https://api.github.com/users/mroeder/events{/privacy}","received_events_url":"https://api.github.com/users/mroeder/received_events","type":"User","site_admin":false},"body":"Implementation of JSON recipes for grammars. Semantics are still JavaScript (functions) since they are also implemented in JavaScript for Ohm/JS.\r\n\r\nReferencing #70 here (it's not a `toJSON` but switching over `toRecipe`).","created_at":"2016-05-25T19:13:28Z","updated_at":"2016-05-30T11:20:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cdglabs/ohm/pulls/109/commits","review_comments_url":"https://api.github.com/repos/cdglabs/ohm/pulls/109/comments","review_comment_url":"https://api.github.com/repos/cdglabs/ohm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cdglabs/ohm/issues/109/comments","statuses_url":"https://api.github.com/repos/cdglabs/ohm/statuses/5cc1f6794f92a9788816bcc9efed78c86e84497f","head":{"label":"cdglabs:json-recipes","ref":"json-recipes","sha":"5cc1f6794f92a9788816bcc9efed78c86e84497f","user":{"login":"cdglabs","id":9912100,"avatar_url":"https://avatars.githubusercontent.com/u/9912100?v=3","gravatar_id":"","url":"https://api.github.com/users/cdglabs","html_url":"https://github.com/cdglabs","followers_url":"https://api.github.com/users/cdglabs/followers","following_url":"https://api.github.com/users/cdglabs/following{/other_user}","gists_url":"https://api.github.com/users/cdglabs/gists{/gist_id}","starred_url":"https://api.github.com/users/cdglabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdglabs/subscriptions","organizations_url":"https://api.github.com/users/cdglabs/orgs","repos_url":"https://api.github.com/users/cdglabs/repos","events_url":"https://api.github.com/users/cdglabs/events{/privacy}","received_events_url":"https://api.github.com/users/cdglabs/received_events","type":"Organization","site_admin":false},"repo":{"id":36021747,"name":"ohm","full_name":"cdglabs/ohm","owner":{"login":"cdglabs","id":9912100,"avatar_url":"https://avatars.githubusercontent.com/u/9912100?v=3","gravatar_id":"","url":"https://api.github.com/users/cdglabs","html_url":"https://github.com/cdglabs","followers_url":"https://api.github.com/users/cdglabs/followers","following_url":"https://api.github.com/users/cdglabs/following{/other_user}","gists_url":"https://api.github.com/users/cdglabs/gists{/gist_id}","starred_url":"https://api.github.com/users/cdglabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdglabs/subscriptions","organizations_url":"https://api.github.com/users/cdglabs/orgs","repos_url":"https://api.github.com/users/cdglabs/repos","events_url":"https://api.github.com/users/cdglabs/events{/privacy}","received_events_url":"https://api.github.com/users/cdglabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cdglabs/ohm","description":"A library and language for parsing and pattern matching.","fork":false,"url":"https://api.github.com/repos/cdglabs/ohm","forks_url":"https://api.github.com/repos/cdglabs/ohm/forks","keys_url":"https://api.github.com/repos/cdglabs/ohm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdglabs/ohm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdglabs/ohm/teams","hooks_url":"https://api.github.com/repos/cdglabs/ohm/hooks","issue_events_url":"https://api.github.com/repos/cdglabs/ohm/issues/events{/number}","events_url":"https://api.github.com/repos/cdglabs/ohm/events","assignees_url":"https://api.github.com/repos/cdglabs/ohm/assignees{/user}","branches_url":"https://api.github.com/repos/cdglabs/ohm/branches{/branch}","tags_url":"https://api.github.com/repos/cdglabs/ohm/tags","blobs_url":"https://api.github.com/repos/cdglabs/ohm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdglabs/ohm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdglabs/ohm/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdglabs/ohm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdglabs/ohm/statuses/{sha}","languages_url":"https://api.github.com/repos/cdglabs/ohm/languages","stargazers_url":"https://api.github.com/repos/cdglabs/ohm/stargazers","contributors_url":"https://api.github.com/repos/cdglabs/ohm/contributors","subscribers_url":"https://api.github.com/repos/cdglabs/ohm/subscribers","subscription_url":"https://api.github.com/repos/cdglabs/ohm/subscription","commits_url":"https://api.github.com/repos/cdglabs/ohm/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdglabs/ohm/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdglabs/ohm/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdglabs/ohm/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdglabs/ohm/contents/{+path}","compare_url":"https://api.github.com/repos/cdglabs/ohm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdglabs/ohm/merges","archive_url":"https://api.github.com/repos/cdglabs/ohm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdglabs/ohm/downloads","issues_url":"https://api.github.com/repos/cdglabs/ohm/issues{/number}","pulls_url":"https://api.github.com/repos/cdglabs/ohm/pulls{/number}","milestones_url":"https://api.github.com/repos/cdglabs/ohm/milestones{/number}","notifications_url":"https://api.github.com/repos/cdglabs/ohm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdglabs/ohm/labels{/name}","releases_url":"https://api.github.com/repos/cdglabs/ohm/releases{/id}","deployments_url":"https://api.github.com/repos/cdglabs/ohm/deployments","created_at":"2015-05-21T15:42:14Z","updated_at":"2016-05-26T14:28:19Z","pushed_at":"2016-05-28T00:19:29Z","git_url":"git://github.com/cdglabs/ohm.git","ssh_url":"git@github.com:cdglabs/ohm.git","clone_url":"https://github.com/cdglabs/ohm.git","svn_url":"https://github.com/cdglabs/ohm","homepage":"","size":17815,"stargazers_count":370,"watchers_count":370,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":21,"mirror_url":null,"open_issues_count":24,"forks":21,"open_issues":24,"watchers":370,"default_branch":"master"}},"base":{"label":"cdglabs:master","ref":"master","sha":"446657a619be95690e1bb2da142b01c3b9b8fc1d","user":{"login":"cdglabs","id":9912100,"avatar_url":"https://avatars.githubusercontent.com/u/9912100?v=3","gravatar_id":"","url":"https://api.github.com/users/cdglabs","html_url":"https://github.com/cdglabs","followers_url":"https://api.github.com/users/cdglabs/followers","following_url":"https://api.github.com/users/cdglabs/following{/other_user}","gists_url":"https://api.github.com/users/cdglabs/gists{/gist_id}","starred_url":"https://api.github.com/users/cdglabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdglabs/subscriptions","organizations_url":"https://api.github.com/users/cdglabs/orgs","repos_url":"https://api.github.com/users/cdglabs/repos","events_url":"https://api.github.com/users/cdglabs/events{/privacy}","received_events_url":"https://api.github.com/users/cdglabs/received_events","type":"Organization","site_admin":false},"repo":{"id":36021747,"name":"ohm","full_name":"cdglabs/ohm","owner":{"login":"cdglabs","id":9912100,"avatar_url":"https://avatars.githubusercontent.com/u/9912100?v=3","gravatar_id":"","url":"https://api.github.com/users/cdglabs","html_url":"https://github.com/cdglabs","followers_url":"https://api.github.com/users/cdglabs/followers","following_url":"https://api.github.com/users/cdglabs/following{/other_user}","gists_url":"https://api.github.com/users/cdglabs/gists{/gist_id}","starred_url":"https://api.github.com/users/cdglabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdglabs/subscriptions","organizations_url":"https://api.github.com/users/cdglabs/orgs","repos_url":"https://api.github.com/users/cdglabs/repos","events_url":"https://api.github.com/users/cdglabs/events{/privacy}","received_events_url":"https://api.github.com/users/cdglabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cdglabs/ohm","description":"A library and language for parsing and pattern matching.","fork":false,"url":"https://api.github.com/repos/cdglabs/ohm","forks_url":"https://api.github.com/repos/cdglabs/ohm/forks","keys_url":"https://api.github.com/repos/cdglabs/ohm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cdglabs/ohm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cdglabs/ohm/teams","hooks_url":"https://api.github.com/repos/cdglabs/ohm/hooks","issue_events_url":"https://api.github.com/repos/cdglabs/ohm/issues/events{/number}","events_url":"https://api.github.com/repos/cdglabs/ohm/events","assignees_url":"https://api.github.com/repos/cdglabs/ohm/assignees{/user}","branches_url":"https://api.github.com/repos/cdglabs/ohm/branches{/branch}","tags_url":"https://api.github.com/repos/cdglabs/ohm/tags","blobs_url":"https://api.github.com/repos/cdglabs/ohm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cdglabs/ohm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cdglabs/ohm/git/refs{/sha}","trees_url":"https://api.github.com/repos/cdglabs/ohm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cdglabs/ohm/statuses/{sha}","languages_url":"https://api.github.com/repos/cdglabs/ohm/languages","stargazers_url":"https://api.github.com/repos/cdglabs/ohm/stargazers","contributors_url":"https://api.github.com/repos/cdglabs/ohm/contributors","subscribers_url":"https://api.github.com/repos/cdglabs/ohm/subscribers","subscription_url":"https://api.github.com/repos/cdglabs/ohm/subscription","commits_url":"https://api.github.com/repos/cdglabs/ohm/commits{/sha}","git_commits_url":"https://api.github.com/repos/cdglabs/ohm/git/commits{/sha}","comments_url":"https://api.github.com/repos/cdglabs/ohm/comments{/number}","issue_comment_url":"https://api.github.com/repos/cdglabs/ohm/issues/comments{/number}","contents_url":"https://api.github.com/repos/cdglabs/ohm/contents/{+path}","compare_url":"https://api.github.com/repos/cdglabs/ohm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cdglabs/ohm/merges","archive_url":"https://api.github.com/repos/cdglabs/ohm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cdglabs/ohm/downloads","issues_url":"https://api.github.com/repos/cdglabs/ohm/issues{/number}","pulls_url":"https://api.github.com/repos/cdglabs/ohm/pulls{/number}","milestones_url":"https://api.github.com/repos/cdglabs/ohm/milestones{/number}","notifications_url":"https://api.github.com/repos/cdglabs/ohm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cdglabs/ohm/labels{/name}","releases_url":"https://api.github.com/repos/cdglabs/ohm/releases{/id}","deployments_url":"https://api.github.com/repos/cdglabs/ohm/deployments","created_at":"2015-05-21T15:42:14Z","updated_at":"2016-05-26T14:28:19Z","pushed_at":"2016-05-28T00:19:29Z","git_url":"git://github.com/cdglabs/ohm.git","ssh_url":"git@github.com:cdglabs/ohm.git","clone_url":"https://github.com/cdglabs/ohm.git","svn_url":"https://github.com/cdglabs/ohm","homepage":"","size":17815,"stargazers_count":370,"watchers_count":370,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":21,"mirror_url":null,"open_issues_count":24,"forks":21,"open_issues":24,"watchers":370,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cdglabs/ohm/pulls/109"},"html":{"href":"https://github.com/cdglabs/ohm/pull/109"},"issue":{"href":"https://api.github.com/repos/cdglabs/ohm/issues/109"},"comments":{"href":"https://api.github.com/repos/cdglabs/ohm/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/cdglabs/ohm/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/cdglabs/ohm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cdglabs/ohm/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/cdglabs/ohm/statuses/5cc1f6794f92a9788816bcc9efed78c86e84497f"}}}}
{"actor":{"display_login":"pdubroy"}}