rouge-lang 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/rouge/reader.rb +5 -6
- data/lib/rouge/seq.rb +4 -0
- data/lib/rouge/version.rb +1 -1
- data/rouge-lang.gemspec +3 -3
- data/spec/builtins_spec.rb +4 -4
- data/spec/reader_spec.rb +7 -0
- data/spec/rouge_spec.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d794a5285762cb5e003cc6deb982c9cdd7fcc59
|
4
|
+
data.tar.gz: ec1fe24b19477275c44c61eac7080cfd5884dd72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e940961915b5c7891228e67a2f3792f274a417d0f1fc3b442ace64d52026f1b5ae64abf953a32a615e532348d8dafa01c98771bd823624481a4e0ad58fa46b2a
|
7
|
+
data.tar.gz: 0558b6945bbb2f6475e50dd2f7cd07be44ab97e34ace4a500fade0248b039a8a38418313bdfa5fbb2b8f42db3af8558721d89b540d82e61df9aba175b45a7a1f
|
data/README.md
CHANGED
@@ -23,8 +23,8 @@ or on `#rouge` on Freenode.
|
|
23
23
|
## example
|
24
24
|
|
25
25
|
See [boot.rg](https://github.com/rouge-lang/rouge/blob/master/lib/boot.rg),
|
26
|
-
[em-rg](https://github.com/
|
27
|
-
[mechanize-rg](https://github.com/
|
26
|
+
[em-rg](https://github.com/kivikakk/em-rg),
|
27
|
+
[mechanize-rg](https://github.com/kivikakk/mechanize-rg), but to demonstrate
|
28
28
|
salient features:
|
29
29
|
|
30
30
|
``` clojure
|
@@ -76,11 +76,11 @@ include:
|
|
76
76
|
* Add tests! This is so I don't break your lovely addition in the future by accident.
|
77
77
|
* Commit and pull request! (Bonus points for topic branches.)
|
78
78
|
|
79
|
-
**Also**, if there's something in particular you want that's missing, feel free to put your vote in by [opening an Issue](https://github.com/
|
79
|
+
**Also**, if there's something in particular you want that's missing, feel free to put your vote in by [opening an Issue](https://github.com/rouge-lang/rouge/issues/new) so I know where to direct my attention.
|
80
80
|
|
81
81
|
## authorship
|
82
82
|
|
83
|
-
Original author: [Arlen Christian Mart Cuss](https://github.com/
|
83
|
+
Original author: [Arlen Christian Mart Cuss](https://github.com/kivikakk).
|
84
84
|
|
85
85
|
Committers:
|
86
86
|
|
data/lib/rouge/reader.rb
CHANGED
@@ -181,7 +181,7 @@ class Rouge::Reader
|
|
181
181
|
Integer(s)
|
182
182
|
end
|
183
183
|
elsif /\A#{RATIONAL}\z/o.match(s)
|
184
|
-
numerator, denominator =
|
184
|
+
numerator, denominator = s.split("/").map {|n| number(n)}
|
185
185
|
Rational(numerator, denominator)
|
186
186
|
else
|
187
187
|
reader_raise NumberFormatError, "Invalid number #{s}", s
|
@@ -189,13 +189,12 @@ class Rouge::Reader
|
|
189
189
|
end
|
190
190
|
|
191
191
|
def keyword
|
192
|
-
|
193
|
-
|
194
|
-
retract!
|
192
|
+
advance!
|
193
|
+
if peek == ?"
|
195
194
|
s = string
|
196
195
|
s.intern
|
197
|
-
|
198
|
-
slurp(
|
196
|
+
else
|
197
|
+
slurp(/^[a-zA-Z0-9\-_!\?\*\/]+/).intern
|
199
198
|
end
|
200
199
|
end
|
201
200
|
|
data/lib/rouge/seq.rb
CHANGED
data/lib/rouge/version.rb
CHANGED
data/rouge-lang.gemspec
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
require File.expand_path('../lib/rouge/version', __FILE__)
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
|
-
gem.authors = ["
|
7
|
-
gem.email = ["
|
6
|
+
gem.authors = ["Amelia Cuss"]
|
7
|
+
gem.email = ["amelia@kivikakk.ee"]
|
8
8
|
gem.description = %q{Ruby + Clojure = Rouge.}
|
9
9
|
gem.summary = %q{An implementation of Clojure for Ruby.}
|
10
|
-
gem.homepage = "
|
10
|
+
gem.homepage = "https://github.com/rouge-lang/rouge"
|
11
11
|
|
12
12
|
gem.add_development_dependency('rake')
|
13
13
|
gem.add_development_dependency('autotest')
|
data/spec/builtins_spec.rb
CHANGED
@@ -220,8 +220,8 @@ describe Rouge::Builtins do
|
|
220
220
|
describe "if" do
|
221
221
|
# TODO: refactor & break out individual assertions
|
222
222
|
it "should execute one branch or the other" do
|
223
|
-
a =
|
224
|
-
b =
|
223
|
+
a = double("a")
|
224
|
+
b = double("b")
|
225
225
|
a.should_receive(:call).with(any_args)
|
226
226
|
b.should_not_receive(:call).with(any_args)
|
227
227
|
subcontext = Rouge::Context.new context
|
@@ -232,7 +232,7 @@ describe Rouge::Builtins do
|
|
232
232
|
|
233
233
|
# TODO: refactor & break out individual assertions
|
234
234
|
it "should not do anything in the case of a missing second branch" do
|
235
|
-
a =
|
235
|
+
a = double("a")
|
236
236
|
a.should_not_receive(:call)
|
237
237
|
subcontext = Rouge::Context.new context
|
238
238
|
subcontext.set_here :a, a
|
@@ -259,7 +259,7 @@ describe Rouge::Builtins do
|
|
259
259
|
|
260
260
|
# TODO: refactor & break out individual assertions
|
261
261
|
it "should evaluate multiple arguments and return the last value" do
|
262
|
-
a =
|
262
|
+
a = double("a")
|
263
263
|
a.should_receive(:call)
|
264
264
|
subcontext = Rouge::Context.new context
|
265
265
|
subcontext.set_here :a, a
|
data/spec/reader_spec.rb
CHANGED
@@ -470,6 +470,13 @@ describe Rouge::Reader do
|
|
470
470
|
it { expect { @ns.read("#_") }.to raise_exception(ex) }
|
471
471
|
it { expect { @ns.read('#"') }.to raise_exception(ex) }
|
472
472
|
end
|
473
|
+
|
474
|
+
describe "symbol edge cases" do
|
475
|
+
it { @ns.read('{:foo "foo:"}').to_s.should eq({foo: "foo:"}.to_s) }
|
476
|
+
it { @ns.read('[(puts :foo) (puts "foo:")]').to_s.should eq(
|
477
|
+
[Rouge::Seq::Cons[Rouge::Symbol[:puts], :foo],
|
478
|
+
Rouge::Seq::Cons[Rouge::Symbol[:puts], "foo:"]].to_s) }
|
479
|
+
end
|
473
480
|
end
|
474
481
|
|
475
482
|
# vim: set sw=2 et cc=80:
|
data/spec/rouge_spec.rb
CHANGED
@@ -15,8 +15,8 @@ describe Rouge do
|
|
15
15
|
|
16
16
|
it "should contain the defn macro" do
|
17
17
|
lambda {
|
18
|
-
@ns[:defn].should be_an_instance_of Rouge::
|
19
|
-
}.should_not raise_exception
|
18
|
+
@ns[:defn].should be_an_instance_of Rouge::Var
|
19
|
+
}.should_not raise_exception
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should contain special variables" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rouge-lang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Amelia Cuss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
version: '0'
|
111
111
|
description: Ruby + Clojure = Rouge.
|
112
112
|
email:
|
113
|
-
-
|
113
|
+
- amelia@kivikakk.ee
|
114
114
|
executables:
|
115
115
|
- rouge
|
116
116
|
extensions: []
|
@@ -160,7 +160,7 @@ files:
|
|
160
160
|
- spec/symbol_spec.rb
|
161
161
|
- spec/var_spec.rb
|
162
162
|
- spec/wrappers_spec.rb
|
163
|
-
homepage:
|
163
|
+
homepage: https://github.com/rouge-lang/rouge
|
164
164
|
licenses: []
|
165
165
|
metadata: {}
|
166
166
|
post_install_message:
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.0.
|
182
|
+
rubygems_version: 2.0.3
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: An implementation of Clojure for Ruby.
|