{"action":"created","comment":{"url":"https://api.github.com/repos/oracle/truffleruby/pulls/comments/184245137","pull_request_review_id":115401215,"id":184245137,"diff_hunk":"@@ -0,0 +1,123 @@\n+# Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. This\n+# code is released under a tri EPL/GPL/LGPL license. You can use it,\n+# redistribute it and/or modify it under the terms of the:\n+#\n+# Eclipse Public License version 1.0\n+# GNU General Public License version 2\n+# GNU Lesser General Public License version 2.1\n+\n+require_relative 'common_patches'\n+\n+class RaccPatches < CommonPatches\n+\n+  CPARSE_PARAM_VALUE_FIELDS = %w[value_v parser lexer action_table action_check action_default action_pointer\n+                                 goto_table goto_check goto_default goto_pointer reduce_table token_table state\n+                                 vstack tstack retval]\n+\n+  def self.generate_cparse_param_handles\n+    CPARSE_PARAM_VALUE_FIELDS.collect do |field|\n+      read_write_field('v', field, true)\n+    end.flatten\n+  end\n+\n+  PATCHES = {\n+    gem: 'racc',\n+    patches: {\n+      'cparse.c' => [\n+        { # Convert fixnum constants to ints because we convert cparse_params.t to an int.\n+            match: /INT2FIX\\((\\w+?_TOKEN)\\)/,\n+            replacement: '\\\\1'\n+        },\n+        { # Change signature because when we call the callback we're not providing a self value -- difference from MRI.\n+            match: 'static VALUE reduce0 _((VALUE block_args, VALUE data, VALUE self));',\n+            replacement: 'static VALUE reduce0 _((VALUE block_args, VALUE data));'\n+        },\n+        { # Change signature because when we call the callback we're not providing a self value -- difference from MRI.\n+            match: 'reduce0(VALUE val, VALUE data, VALUE self)',\n+            replacement: 'reduce0(VALUE val, VALUE data)'\n+        },\n+        { # We don't guarantee we #define macros, but racc has backwards-compatiblity code to check for them. Undo racc's work to avoid bad redefinitions of our implementations.\n+            match: 'define ID2SYM(i) ULONG2NUM(i)',\n+            replacement: 'define ID2SYM_DEAD_CODE(i) ULONG2NUM(i)'\n+        },\n+        { # We don't guarantee we #define macros, but racc has backwards-compatiblity code to check for them. Undo racc's work to avoid bad redefinitions of our implementations.\n+            match: 'define SYM2ID(v) ((ID)NUM2ULONG(v))',\n+            replacement: 'define SYM2ID_DEAD_CODE(v) ((ID)NUM2ULONG(v))'\n+        },\n+        { # We don't guarantee we #define macros, but racc has backwards-compatiblity code to check for them. Undo racc's work to avoid bad redefinitions of our implementations.\n+            match: 'define SYMBOL_P(v) FIXNUM_P(v)',\n+            replacement: 'define SYMBOL_P_DEAD_CODE(v) FIXNUM_P(v)'\n+        },\n+        { # We don't guarantee we #define macros, but racc has backwards-compatiblity code to check for them. Undo racc's work to avoid bad redefinitions of our implementations.\n+            match: 'define LONG2NUM(i) INT2NUM(i)',\n+            replacement: 'define LONG2NUM_DEAD_CODE(i) INT2NUM(i)'\n+        },\n+        { # racc_cparse and racc_yyparse\n+          match: 'volatile VALUE',\n+          replacement: 'VALUE'\n+        },\n+        { # struct cparse_params. Creating a handle for a primitive value doesn't seem to work, so convert the `Fixnum` field to an `int` to avoid the need for a handle.\n+          match: 'VALUE t;',\n+          replacement: 'int t;'\n+        },\n+        { # initialize_params\n+          match: 'v->t = INT2FIX(FINAL_TOKEN + 1);',\n+          replacement: 'v->t = FINAL_TOKEN + 1;'","path":"lib/cext/patches/racc_patches.rb","position":39,"original_position":65,"commit_id":"b454ef4419ba1694977a1ecefbf7b71688990307","original_commit_id":"8551b1479a774af993ee0043140b7b5760a8db19","user":{"login":"nirvdrum","id":12584,"avatar_url":"https://avatars2.githubusercontent.com/u/12584?v=4","gravatar_id":"","url":"https://api.github.com/users/nirvdrum","html_url":"https://github.com/nirvdrum","followers_url":"https://api.github.com/users/nirvdrum/followers","following_url":"https://api.github.com/users/nirvdrum/following{/other_user}","gists_url":"https://api.github.com/users/nirvdrum/gists{/gist_id}","starred_url":"https://api.github.com/users/nirvdrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirvdrum/subscriptions","organizations_url":"https://api.github.com/users/nirvdrum/orgs","repos_url":"https://api.github.com/users/nirvdrum/repos","events_url":"https://api.github.com/users/nirvdrum/events{/privacy}","received_events_url":"https://api.github.com/users/nirvdrum/received_events","type":"User","site_admin":false},"body":"I was trying to group by function, but I've moved this set together.","created_at":"2018-04-26T00:48:57Z","updated_at":"2018-04-26T00:48:57Z","html_url":"https://github.com/oracle/truffleruby/pull/1356#discussion_r184245137","pull_request_url":"https://api.github.com/repos/oracle/truffleruby/pulls/1356","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/oracle/truffleruby/pulls/comments/184245137"},"html":{"href":"https://github.com/oracle/truffleruby/pull/1356#discussion_r184245137"},"pull_request":{"href":"https://api.github.com/repos/oracle/truffleruby/pulls/1356"}},"in_reply_to_id":184193330},"pull_request":{"url":"https://api.github.com/repos/oracle/truffleruby/pulls/1356","id":184137577,"html_url":"https://github.com/oracle/truffleruby/pull/1356","diff_url":"https://github.com/oracle/truffleruby/pull/1356.diff","patch_url":"https://github.com/oracle/truffleruby/pull/1356.patch","issue_url":"https://api.github.com/repos/oracle/truffleruby/issues/1356","number":1356,"state":"open","locked":false,"title":"Add patches to make the 'racc' gem work.","user":{"login":"nirvdrum","id":12584,"avatar_url":"https://avatars2.githubusercontent.com/u/12584?v=4","gravatar_id":"","url":"https://api.github.com/users/nirvdrum","html_url":"https://github.com/nirvdrum","followers_url":"https://api.github.com/users/nirvdrum/followers","following_url":"https://api.github.com/users/nirvdrum/following{/other_user}","gists_url":"https://api.github.com/users/nirvdrum/gists{/gist_id}","starred_url":"https://api.github.com/users/nirvdrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nirvdrum/subscriptions","organizations_url":"https://api.github.com/users/nirvdrum/orgs","repos_url":"https://api.github.com/users/nirvdrum/repos","events_url":"https://api.github.com/users/nirvdrum/events{/privacy}","received_events_url":"https://api.github.com/users/nirvdrum/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-25T19:21:17Z","updated_at":"2018-04-26T00:48:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0a6b5fb31fcf4bc7498c9f29173c45653633cc9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pitr-ch","id":204460,"avatar_url":"https://avatars2.githubusercontent.com/u/204460?v=4","gravatar_id":"","url":"https://api.github.com/users/pitr-ch","html_url":"https://github.com/pitr-ch","followers_url":"https://api.github.com/users/pitr-ch/followers","following_url":"https://api.github.com/users/pitr-ch/following{/other_user}","gists_url":"https://api.github.com/users/pitr-ch/gists{/gist_id}","starred_url":"https://api.github.com/users/pitr-ch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pitr-ch/subscriptions","organizations_url":"https://api.github.com/users/pitr-ch/orgs","repos_url":"https://api.github.com/users/pitr-ch/repos","events_url":"https://api.github.com/users/pitr-ch/events{/privacy}","received_events_url":"https://api.github.com/users/pitr-ch/received_events","type":"User","site_admin":false},{"login":"chrisseaton","id":341094,"avatar_url":"https://avatars2.githubusercontent.com/u/341094?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisseaton","html_url":"https://github.com/chrisseaton","followers_url":"https://api.github.com/users/chrisseaton/followers","following_url":"https://api.github.com/users/chrisseaton/following{/other_user}","gists_url":"https://api.github.com/users/chrisseaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisseaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisseaton/subscriptions","organizations_url":"https://api.github.com/users/chrisseaton/orgs","repos_url":"https://api.github.com/users/chrisseaton/repos","events_url":"https://api.github.com/users/chrisseaton/events{/privacy}","received_events_url":"https://api.github.com/users/chrisseaton/received_events","type":"User","site_admin":false},{"login":"aardvark179","id":17862353,"avatar_url":"https://avatars1.githubusercontent.com/u/17862353?v=4","gravatar_id":"","url":"https://api.github.com/users/aardvark179","html_url":"https://github.com/aardvark179","followers_url":"https://api.github.com/users/aardvark179/followers","following_url":"https://api.github.com/users/aardvark179/following{/other_user}","gists_url":"https://api.github.com/users/aardvark179/gists{/gist_id}","starred_url":"https://api.github.com/users/aardvark179/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aardvark179/subscriptions","organizations_url":"https://api.github.com/users/aardvark179/orgs","repos_url":"https://api.github.com/users/aardvark179/repos","events_url":"https://api.github.com/users/aardvark179/events{/privacy}","received_events_url":"https://api.github.com/users/aardvark179/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/oracle/truffleruby/pulls/1356/commits","review_comments_url":"https://api.github.com/repos/oracle/truffleruby/pulls/1356/comments","review_comment_url":"https://api.github.com/repos/oracle/truffleruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oracle/truffleruby/issues/1356/comments","statuses_url":"https://api.github.com/repos/oracle/truffleruby/statuses/b454ef4419ba1694977a1ecefbf7b71688990307","head":{"label":"oracle:support-racc","ref":"support-racc","sha":"b454ef4419ba1694977a1ecefbf7b71688990307","user":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"repo":{"id":51164398,"name":"truffleruby","full_name":"oracle/truffleruby","owner":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oracle/truffleruby","description":"A high performance implementation of the Ruby programming language. Built on the GraalVM by Oracle Labs.","fork":false,"url":"https://api.github.com/repos/oracle/truffleruby","forks_url":"https://api.github.com/repos/oracle/truffleruby/forks","keys_url":"https://api.github.com/repos/oracle/truffleruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oracle/truffleruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oracle/truffleruby/teams","hooks_url":"https://api.github.com/repos/oracle/truffleruby/hooks","issue_events_url":"https://api.github.com/repos/oracle/truffleruby/issues/events{/number}","events_url":"https://api.github.com/repos/oracle/truffleruby/events","assignees_url":"https://api.github.com/repos/oracle/truffleruby/assignees{/user}","branches_url":"https://api.github.com/repos/oracle/truffleruby/branches{/branch}","tags_url":"https://api.github.com/repos/oracle/truffleruby/tags","blobs_url":"https://api.github.com/repos/oracle/truffleruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oracle/truffleruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oracle/truffleruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/oracle/truffleruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oracle/truffleruby/statuses/{sha}","languages_url":"https://api.github.com/repos/oracle/truffleruby/languages","stargazers_url":"https://api.github.com/repos/oracle/truffleruby/stargazers","contributors_url":"https://api.github.com/repos/oracle/truffleruby/contributors","subscribers_url":"https://api.github.com/repos/oracle/truffleruby/subscribers","subscription_url":"https://api.github.com/repos/oracle/truffleruby/subscription","commits_url":"https://api.github.com/repos/oracle/truffleruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/oracle/truffleruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/oracle/truffleruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/oracle/truffleruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/oracle/truffleruby/contents/{+path}","compare_url":"https://api.github.com/repos/oracle/truffleruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oracle/truffleruby/merges","archive_url":"https://api.github.com/repos/oracle/truffleruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oracle/truffleruby/downloads","issues_url":"https://api.github.com/repos/oracle/truffleruby/issues{/number}","pulls_url":"https://api.github.com/repos/oracle/truffleruby/pulls{/number}","milestones_url":"https://api.github.com/repos/oracle/truffleruby/milestones{/number}","notifications_url":"https://api.github.com/repos/oracle/truffleruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oracle/truffleruby/labels{/name}","releases_url":"https://api.github.com/repos/oracle/truffleruby/releases{/id}","deployments_url":"https://api.github.com/repos/oracle/truffleruby/deployments","created_at":"2016-02-05T18:03:11Z","updated_at":"2018-04-26T00:48:10Z","pushed_at":"2018-04-26T00:48:09Z","git_url":"git://github.com/oracle/truffleruby.git","ssh_url":"git@github.com:oracle/truffleruby.git","clone_url":"https://github.com/oracle/truffleruby.git","svn_url":"https://github.com/oracle/truffleruby","homepage":"","size":228225,"stargazers_count":1223,"watchers_count":1223,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":47,"open_issues":31,"watchers":1223,"default_branch":"master"}},"base":{"label":"oracle:master","ref":"master","sha":"448d3e590eca65ba63d254f25e4b3d8319058a36","user":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"repo":{"id":51164398,"name":"truffleruby","full_name":"oracle/truffleruby","owner":{"login":"oracle","id":4430336,"avatar_url":"https://avatars1.githubusercontent.com/u/4430336?v=4","gravatar_id":"","url":"https://api.github.com/users/oracle","html_url":"https://github.com/oracle","followers_url":"https://api.github.com/users/oracle/followers","following_url":"https://api.github.com/users/oracle/following{/other_user}","gists_url":"https://api.github.com/users/oracle/gists{/gist_id}","starred_url":"https://api.github.com/users/oracle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oracle/subscriptions","organizations_url":"https://api.github.com/users/oracle/orgs","repos_url":"https://api.github.com/users/oracle/repos","events_url":"https://api.github.com/users/oracle/events{/privacy}","received_events_url":"https://api.github.com/users/oracle/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oracle/truffleruby","description":"A high performance implementation of the Ruby programming language. Built on the GraalVM by Oracle Labs.","fork":false,"url":"https://api.github.com/repos/oracle/truffleruby","forks_url":"https://api.github.com/repos/oracle/truffleruby/forks","keys_url":"https://api.github.com/repos/oracle/truffleruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oracle/truffleruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oracle/truffleruby/teams","hooks_url":"https://api.github.com/repos/oracle/truffleruby/hooks","issue_events_url":"https://api.github.com/repos/oracle/truffleruby/issues/events{/number}","events_url":"https://api.github.com/repos/oracle/truffleruby/events","assignees_url":"https://api.github.com/repos/oracle/truffleruby/assignees{/user}","branches_url":"https://api.github.com/repos/oracle/truffleruby/branches{/branch}","tags_url":"https://api.github.com/repos/oracle/truffleruby/tags","blobs_url":"https://api.github.com/repos/oracle/truffleruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oracle/truffleruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oracle/truffleruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/oracle/truffleruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oracle/truffleruby/statuses/{sha}","languages_url":"https://api.github.com/repos/oracle/truffleruby/languages","stargazers_url":"https://api.github.com/repos/oracle/truffleruby/stargazers","contributors_url":"https://api.github.com/repos/oracle/truffleruby/contributors","subscribers_url":"https://api.github.com/repos/oracle/truffleruby/subscribers","subscription_url":"https://api.github.com/repos/oracle/truffleruby/subscription","commits_url":"https://api.github.com/repos/oracle/truffleruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/oracle/truffleruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/oracle/truffleruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/oracle/truffleruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/oracle/truffleruby/contents/{+path}","compare_url":"https://api.github.com/repos/oracle/truffleruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oracle/truffleruby/merges","archive_url":"https://api.github.com/repos/oracle/truffleruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oracle/truffleruby/downloads","issues_url":"https://api.github.com/repos/oracle/truffleruby/issues{/number}","pulls_url":"https://api.github.com/repos/oracle/truffleruby/pulls{/number}","milestones_url":"https://api.github.com/repos/oracle/truffleruby/milestones{/number}","notifications_url":"https://api.github.com/repos/oracle/truffleruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oracle/truffleruby/labels{/name}","releases_url":"https://api.github.com/repos/oracle/truffleruby/releases{/id}","deployments_url":"https://api.github.com/repos/oracle/truffleruby/deployments","created_at":"2016-02-05T18:03:11Z","updated_at":"2018-04-26T00:48:10Z","pushed_at":"2018-04-26T00:48:09Z","git_url":"git://github.com/oracle/truffleruby.git","ssh_url":"git@github.com:oracle/truffleruby.git","clone_url":"https://github.com/oracle/truffleruby.git","svn_url":"https://github.com/oracle/truffleruby","homepage":"","size":228225,"stargazers_count":1223,"watchers_count":1223,"language":"Ruby","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":47,"open_issues":31,"watchers":1223,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oracle/truffleruby/pulls/1356"},"html":{"href":"https://github.com/oracle/truffleruby/pull/1356"},"issue":{"href":"https://api.github.com/repos/oracle/truffleruby/issues/1356"},"comments":{"href":"https://api.github.com/repos/oracle/truffleruby/issues/1356/comments"},"review_comments":{"href":"https://api.github.com/repos/oracle/truffleruby/pulls/1356/comments"},"review_comment":{"href":"https://api.github.com/repos/oracle/truffleruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oracle/truffleruby/pulls/1356/commits"},"statuses":{"href":"https://api.github.com/repos/oracle/truffleruby/statuses/b454ef4419ba1694977a1ecefbf7b71688990307"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nirvdrum"}}