minruby 1.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/minruby.rb +6 -6
  4. data/minruby.gemspec +2 -2
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39f7f065132debe11242193f8be1fe7d820e17c4
4
- data.tar.gz: 213eff7a9b7da0f576bf059b282145d5d334a0c1
3
+ metadata.gz: b340f255579f114e1a15261de55aac35ec12877c
4
+ data.tar.gz: a57a58ae0e2933d5bd35d4a4580fe58786547cfb
5
5
  SHA512:
6
- metadata.gz: 121f1dc50cfd70035b8cdd7d93fb57302bc2d99ac65f554ed0d8ccd5dd8890698e1e28b87e7c8680bec9e2ed079c10b4c26b9930fc1bdde617fb8cec27868a9d
7
- data.tar.gz: 314bdb65c1fefe2c03ca5029e0db7367456ae552ccc5679605a1c70fdd4f5cb2e86e9edfcd1f91ac10a98195b068bbf77de55bcac2b25b477d2026c397720c49
6
+ metadata.gz: 3f37d3ef1444db0840e31a0c4dd4ae732a99b89547312047a974d1ba0f6a2959f1e6f74e633bd0c15303cf39052d381c548d79f74d715c5a336ee3358b741edc
7
+ data.tar.gz: 98d2f0c24c428f7fb319e68f8309dddabc8c7360c2df89da23dd8009c5a04a5bd1f0163aaadd795b105d9b795c62d4b4deb59b8a047b29d449263479927e8a1f
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # 『Ruby で学ぶ Ruby』用ライブラリ
1
+ # 『Ruby で学ぶ Ruby』用補助ライブラリ
2
2
 
3
3
  ASCII.jp の Web 連載『[Ruby で学ぶ Ruby](http://ascii.jp/elem/000/001/230/1230449/)』のための補助ライブラリです。
4
4
 
@@ -17,7 +17,7 @@ ASCII.jp の Web 連載『[Ruby で学ぶ Ruby](http://ascii.jp/elem/000/001/230
17
17
 
18
18
  ## 別のインストール方法
19
19
 
20
- `gem` でのインストールがうまく行かない場合は、[ライブラリのファイル](https://github.com/mame/minruby/lib/minruby.rb)をダウンロードしてあなたのプログラムと同じフォルダに置いてください。それから、あなたのプログラムの最初の行に
20
+ `gem` でのインストールがうまく行かない場合は、[ライブラリのファイル](https://raw.githubusercontent.com/mame/minruby/master/lib/minruby.rb)をダウンロードしてあなたのプログラムと同じフォルダに置いてください。それから、あなたのプログラムの最初の行に
21
21
 
22
22
  require "./minruby"
23
23
 
data/lib/minruby.rb CHANGED
@@ -27,19 +27,19 @@ class MinRubyParser
27
27
  ["method_call", recv, name, []]
28
28
  when :fcall
29
29
  name = exp[1][1]
30
- ["func_call", name, []]
30
+ ["func_call", name]
31
31
  when :method_add_arg
32
32
  call = simplify(exp[1])
33
33
  e = exp[2]
34
34
  e = e[1] || [] if e[0] == :arg_paren
35
35
  e = e[1] || [] if e[0] == :args_add_block
36
36
  e = e.map {|e_| simplify(e_) }
37
- call[call[0] == "func_call" ? 2 : 3] = e
37
+ call[(call[0] == "func_call" ? 2 : 3)..-1] = e
38
38
  call
39
39
  when :command
40
40
  name = exp[1][1]
41
41
  args = exp[2][1].map {|e_| simplify(e_) }
42
- ["func_call", name, args]
42
+ ["func_call", name, *args]
43
43
  when :if, :elsif
44
44
  cond_exp = simplify(exp[1])
45
45
  then_exp = make_stmts(exp[2])
@@ -123,15 +123,15 @@ class MinRubyParser
123
123
  when :array
124
124
  ["ary_new", *(exp[1] ? exp[1].map {|e_| simplify(e_) } : [])]
125
125
  when :hash
126
- kvs = []
126
+ kvs = ["hash_new"]
127
127
  if exp[1]
128
128
  exp[1][1].each do |e_|
129
129
  key = simplify(e_[1])
130
130
  val = simplify(e_[2])
131
- kvs << [key, val]
131
+ kvs << key << val
132
132
  end
133
133
  end
134
- ["hash_new", kvs]
134
+ kvs
135
135
  when :void_stmt
136
136
  ["lit", nil]
137
137
  when :paren
data/minruby.gemspec CHANGED
@@ -1,12 +1,12 @@
1
1
  # coding: utf-8
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "minruby"
4
- spec.version = "1.0"
4
+ spec.version = "1.0.1"
5
5
  spec.authors = ["Yusuke Endoh"]
6
6
  spec.email = ["mame@ruby-lang.org"]
7
7
 
8
8
  spec.summary = %q{A helper library for "Ruby de manabu Ruby"}
9
- spec.description = %q{This library provides some helper modules to implement a toy Ruby implementation. This is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by Ruby)", in ASCII.jp}
9
+ spec.description = %q{This library provides some helper modules to implement a toy Ruby implementation. This is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by implementing Ruby)", in ASCII.jp}
10
10
  spec.homepage = "http://github.com/mame/minruby/"
11
11
  spec.license = "MIT"
12
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke Endoh
@@ -39,8 +39,8 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  description: This library provides some helper modules to implement a toy Ruby implementation. This
42
- is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by Ruby)",
43
- in ASCII.jp
42
+ is created for a series of articles, "Ruby de manabu Ruby (Learning Ruby by implementing
43
+ Ruby)", in ASCII.jp
44
44
  email:
45
45
  - mame@ruby-lang.org
46
46
  executables: []