clj 0.0.7.2 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/clj/parser.c +5 -7
- data/lib/clj.rb +1 -4
- data/lib/clj/parser.rb +4 -5
- data/lib/clj/types.rb +4 -1
- metadata +5 -5
data/ext/clj/parser.c
CHANGED
@@ -397,17 +397,15 @@ static VALUE read_set (STATE)
|
|
397
397
|
SEEK(2); CALL(ignore);
|
398
398
|
|
399
399
|
while (CURRENT != '}') {
|
400
|
-
rb_funcall(result, rb_intern("
|
400
|
+
if (NIL_P(rb_funcall(result, rb_intern("add?"), 1, CALL(read_next)))) {
|
401
|
+
rb_raise(rb_eSyntaxError, "the set contains non unique values");
|
402
|
+
}
|
401
403
|
|
402
404
|
CALL(ignore);
|
403
405
|
}
|
404
406
|
|
405
407
|
SEEK(1);
|
406
408
|
|
407
|
-
if (!NIL_P(rb_funcall(result, rb_intern("uniq!"), 0))) {
|
408
|
-
rb_raise(rb_eSyntaxError, "the set contains non unique values");
|
409
|
-
}
|
410
|
-
|
411
409
|
return result;
|
412
410
|
}
|
413
411
|
|
@@ -499,14 +497,14 @@ static VALUE t_init (int argc, VALUE* argv, VALUE self)
|
|
499
497
|
rb_iv_set(self, "@list_class", tmp);
|
500
498
|
}
|
501
499
|
else {
|
502
|
-
rb_iv_set(self, "@list_class", rb_const_get(cClojure, rb_intern("
|
500
|
+
rb_iv_set(self, "@list_class", rb_const_get(cClojure, rb_intern("List")));
|
503
501
|
}
|
504
502
|
|
505
503
|
if (!NIL_P(tmp = rb_hash_aref(options, rb_intern("set_class")))) {
|
506
504
|
rb_iv_set(self, "@set_class", tmp);
|
507
505
|
}
|
508
506
|
else {
|
509
|
-
rb_iv_set(self, "@set_class", rb_const_get(cClojure, rb_intern("
|
507
|
+
rb_iv_set(self, "@set_class", rb_const_get(cClojure, rb_intern("Set")));
|
510
508
|
}
|
511
509
|
|
512
510
|
return self;
|
data/lib/clj.rb
CHANGED
@@ -8,9 +8,6 @@
|
|
8
8
|
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
9
9
|
#++
|
10
10
|
|
11
|
-
require 'date'
|
12
|
-
require 'bigdecimal'
|
13
|
-
|
14
11
|
module Clojure
|
15
12
|
def self.parse (*args)
|
16
13
|
Clojure::Parser.new(*args).parse
|
@@ -72,7 +69,7 @@ end
|
|
72
69
|
require 'clj/types'
|
73
70
|
|
74
71
|
begin
|
75
|
-
raise LoadError if RUBY_ENGINE == 'jruby'
|
72
|
+
raise LoadError if RUBY_ENGINE == 'jruby' || ENV['CLJ_NO_C_EXT']
|
76
73
|
|
77
74
|
require 'clj/parser_ext'
|
78
75
|
rescue LoadError
|
data/lib/clj/parser.rb
CHANGED
@@ -285,16 +285,15 @@ private
|
|
285
285
|
ignore
|
286
286
|
|
287
287
|
while lookahead(1) != '}'
|
288
|
-
result
|
288
|
+
unless result.add? read_next
|
289
|
+
raise SyntaxError, 'the set contains non unique values'
|
290
|
+
end
|
291
|
+
|
289
292
|
ignore
|
290
293
|
end
|
291
294
|
|
292
295
|
@source.read(1)
|
293
296
|
|
294
|
-
if result.uniq!
|
295
|
-
raise SyntaxError, 'the set contains non unique values'
|
296
|
-
end
|
297
|
-
|
298
297
|
result
|
299
298
|
end
|
300
299
|
|
data/lib/clj/types.rb
CHANGED
@@ -9,6 +9,9 @@
|
|
9
9
|
#++
|
10
10
|
|
11
11
|
require 'forwardable'
|
12
|
+
require 'set'
|
13
|
+
require 'date'
|
14
|
+
require 'bigdecimal'
|
12
15
|
|
13
16
|
module Clojure
|
14
17
|
module Metadata
|
@@ -68,7 +71,7 @@ module Clojure
|
|
68
71
|
end
|
69
72
|
end
|
70
73
|
|
71
|
-
class Set <
|
74
|
+
class Set < Set
|
72
75
|
include Clojure::Metadata
|
73
76
|
|
74
77
|
def to_clj (options = {})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-06 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &15097740 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *15097740
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &15096280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *15096280
|
36
36
|
description:
|
37
37
|
email: meh@paranoici.org
|
38
38
|
executables: []
|