clj 0.0.7 → 0.0.7.1
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 +17 -2
- data/lib/clj/parser.rb +2 -3
- metadata +5 -5
data/ext/clj/parser.c
CHANGED
@@ -522,8 +522,10 @@ static VALUE t_init (int argc, VALUE* argv, VALUE self)
|
|
522
522
|
|
523
523
|
static VALUE t_parse (VALUE self)
|
524
524
|
{
|
525
|
+
char* string;
|
525
526
|
size_t position = 0;
|
526
|
-
VALUE source
|
527
|
+
VALUE source = rb_iv_get(self, "@source");
|
528
|
+
VALUE result;
|
527
529
|
|
528
530
|
if (!rb_obj_is_kind_of(source, rb_cString)) {
|
529
531
|
if (rb_obj_is_kind_of(source, rb_cIO)) {
|
@@ -534,7 +536,20 @@ static VALUE t_parse (VALUE self)
|
|
534
536
|
}
|
535
537
|
}
|
536
538
|
|
537
|
-
|
539
|
+
rb_gc_register_address(&source);
|
540
|
+
|
541
|
+
string = StringValueCStr(source);
|
542
|
+
result = read_next(self, string, &position);
|
543
|
+
|
544
|
+
ignore(self, string, &position);
|
545
|
+
|
546
|
+
if (string[position] != '\0') {
|
547
|
+
rb_raise(rb_eSyntaxError, "there is some unconsumed input");
|
548
|
+
}
|
549
|
+
|
550
|
+
rb_gc_unregister_address(&source);
|
551
|
+
|
552
|
+
return result;
|
538
553
|
}
|
539
554
|
|
540
555
|
void
|
data/lib/clj/parser.rb
CHANGED
@@ -13,8 +13,7 @@ require 'stringio'
|
|
13
13
|
module Clojure
|
14
14
|
|
15
15
|
class Parser
|
16
|
-
NUMBERS
|
17
|
-
SYMBOL = ('0' .. '9').to_a | ('a' .. 'z').to_a | ('A' .. 'Z').to_a | %w[+ ! - _ ? . : /]
|
16
|
+
NUMBERS = '0' .. '9'
|
18
17
|
|
19
18
|
UNICODE_REGEX = /[0-9|a-f|A-F]{4}/
|
20
19
|
OCTAL_REGEX = /[0-3]?[0-7]?[0-7]/
|
@@ -342,7 +341,7 @@ private
|
|
342
341
|
end
|
343
342
|
|
344
343
|
def is_symbol? (ch)
|
345
|
-
|
344
|
+
(ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z') || (ch >= 'A' || ch <= 'Z') || ch == '+' || ch == '!' || ch == '-' || ch == '_' || ch == '?' || ch == '.' || ch == ':' || ch == '/'
|
346
345
|
end
|
347
346
|
|
348
347
|
def both_separator? (ch)
|
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.7
|
4
|
+
version: 0.0.7.1
|
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: &9939580 !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: *9939580
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &9938800 !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: *9938800
|
36
36
|
description:
|
37
37
|
email: meh@paranoici.org
|
38
38
|
executables: []
|