Skip to content

Instantly share code, notes, and snippets.

@unak
Last active December 31, 2015 00:19
Show Gist options
  • Save unak/7906475 to your computer and use it in GitHub Desktop.
Save unak/7906475 to your computer and use it in GitHub Desktop.
※あとで消す 第2版。手抜き。ripper用コードはあってるかどうか知らん。
Index: defs/id.def
===================================================================
--- defs/id.def (リビジョン 44137)
+++ defs/id.def (作業コピー)
@@ -1,5 +1,6 @@
# -*- mode: ruby; coding: us-ascii -*-
firstline, predefined = __LINE__+1, %[\
+ class
freeze
inspect
intern
Index: parse.y
===================================================================
--- parse.y (リビジョン 44137)
+++ parse.y (作業コピー)
@@ -3032,6 +3032,14 @@
$$ = $1;
%*/
}
+ | keyword_class
+ {
+ /*%%%*/
+ $$ = NEW_FCALL(idClass, 0);
+ /*%
+ $$ = method_arg(dispatch1(fcall, idClass), arg_new());
+ %*/
+ }
;
k_begin : keyword_begin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment