-
Notifications
You must be signed in to change notification settings - Fork 7
/
rcodetools.sxmp
79 lines (79 loc) · 4.75 KB
/
rcodetools.sxmp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
$ ruby='ruby -Ilib '
$ export path=~/rcodetools/bin:$PATH
$ echo '1.objec' | ruby -d -S rct-complete --dev --completion-emacs-icicles --line=1
expr_orig=1.objec
expr(sliced)=1.objec
aref_or_aset=nil
expr(before set_last_word)=1.objec
expr(strip opchars)=1.objec
expr.eval_string=1
expr.meth=objec
expr(after set_last_word)=1.objec
expr(processed)=1.objec
newcode
((_xmp_1177764661_24372_531875_recv = (1)
_xmp_1177764661_24372_531875 = (((1).methods(true)).map{|m| "#{m}\0" + (( _xmp_1177764661_24372_531875_result = 1.method(m).inspect.match( %r[\A#<(?:Unbound)?Method: (.*?)>\Z] )[1].sub(/\A.*?\((.*?)\)(.*)\Z/){ "#{$1}#{$2}" }.sub(/#<Class:(.*?)>#/) { "#{$1}." }
_xmp_1177764661_24372_531875_result = 1.to_s + ".new" if _xmp_1177764661_24372_531875_result == 'Class#new' and 1.private_method_defined?(:initialize)
_xmp_1177764661_24372_531875_result = "Object#" + m if _xmp_1177764661_24372_531875_result =~ /^Kernel#/ and Kernel.instance_methods(false).include? m
_xmp_1177764661_24372_531875_result
))
}).grep(/^objec/)
_xmp_1177764661_24372_531875_recv = Module === _xmp_1177764661_24372_531875_recv ? _xmp_1177764661_24372_531875_recv : _xmp_1177764661_24372_531875_recv.class
$stderr.puts("!XMP1177764661_24372_198701![1] => " + _xmp_1177764661_24372_531875_recv.to_s + " " + _xmp_1177764661_24372_531875.join(" ")) || _xmp_1177764661_24372_531875
exit
))
--------------------------------------------------------------------------------
stderr
!XMP1177764661_24372_198701![1] => Fixnum object_id Object#object_id
--------------------------------------------------------------------------------
dat = ["Fixnum", "object_id\000Object#object_id"]
(progn
(setq rct-method-completion-table '(("object_id\t[Object#object_id]") ))
(setq alist '(("object_id" . "Object#object_id")))
(setq pattern "objec")
(setq klass "Fixnum")
)
$ ruby -d -S rct-complete --dev --completion-emacs-icicles -S rct-fork-client --line=2 --column=2 /tmp/rs.rb
expr_orig=fo
expr(sliced)=fo
aref_or_aset=nil
expr(before set_last_word)=fo
expr(strip opchars)=fo
expr.eval_string=
expr.meth=
expr(after set_last_word)=fo
expr(processed)=fo
newcode
require 'foo'
((_xmp_1177764661_24376_874435_recv = (self)
_xmp_1177764661_24376_874435 = ((methods | private_methods).map{|m| "#{m}\0" + (( _xmp_1177764661_24376_874435_result = self.method(m).inspect.match( %r[\A#<(?:Unbound)?Method: (.*?)>\Z] )[1].sub(/\A.*?\((.*?)\)(.*)\Z/){ "#{$1}#{$2}" }.sub(/#<Class:(.*?)>#/) { "#{$1}." }
_xmp_1177764661_24376_874435_result = self.to_s + ".new" if _xmp_1177764661_24376_874435_result == 'Class#new' and self.private_method_defined?(:initialize)
_xmp_1177764661_24376_874435_result = "Object#" + m if _xmp_1177764661_24376_874435_result =~ /^Kernel#/ and Kernel.instance_methods(false).include? m
_xmp_1177764661_24376_874435_result
))
} + local_variables | self.class.constants).grep(/^fo/)
_xmp_1177764661_24376_874435_recv = Module === _xmp_1177764661_24376_874435_recv ? _xmp_1177764661_24376_874435_recv : _xmp_1177764661_24376_874435_recv.class
$stderr.puts("!XMP1177764661_24376_375351![1] => " + _xmp_1177764661_24376_874435_recv.to_s + " " + _xmp_1177764661_24376_874435.join(" ")) || _xmp_1177764661_24376_874435
exit
))
--------------------------------------------------------------------------------
execute command = rct-fork-client -I/m/home/rubikitch/src/rcodetools/bin:/m/home/rubikitch/src/rcodetools/lib -e $stdout.reopen('/m/home/rubikitch/src/rcodetools/xmpfilter.tmpfile_stdout.rb', 'w');$stderr.reopen('/m/home/rubikitch/src/rcodetools/xmpfilter.tmpfile_stderr.rb', 'w');$0.replace '/m/home/rubikitch/src/rcodetools/xmpfilter.tmpfile_stdin.rb';ARGV.replace([]);load "/m/home/rubikitch/src/rcodetools/xmpfilter.tmpfile_stdin.rb";
stderr
!XMP1177764661_24376_375351![1] => Object foo Object#foo fork Kernel#fork format Kernel#format
--------------------------------------------------------------------------------
dat = ["Object", "foo\000Object#foo fork\000Kernel#fork format\000Kernel#format"]
(progn
(setq rct-method-completion-table '(("foo\t[Object#foo]") ("fork\t[Kernel#fork]") ("format\t[Kernel#format]") ))
(setq alist '(("foo" . "Object#foo")("fork" . "Kernel#fork")("format" . "Kernel#format")))
(setq pattern "fo")
(setq klass "Object")
)
$ ruby -S rct-complete --dev --completion-emacs-icicles -S rct-fork-client --line=2 --column=2 /tmp/rs.rb
(progn
(setq rct-method-completion-table '(("foo\t[Object#foo]") ("fork\t[Kernel#fork]") ("format\t[Kernel#format]") ))
(setq alist '(("foo" . "Object#foo")("fork" . "Kernel#fork")("format" . "Kernel#format")))
(setq pattern "fo")
(setq klass "Object")
)
$ #cd ~/ruby; ruby -S rct-complete --dev --completion-emacs-icicles -S rct-fork-client --line=2 --column=2 /tmp/rs.rb
$ # cd ~/ruby; ruby -d -S rct-complete --dev --completion-emacs-icicles -S rct-fork-client --line=2 --column=2 /tmp/rs.rb