clj 0.0.5.5 → 0.0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/clj.rb +3 -0
- data/lib/clj/parser.rb +13 -13
- data/lib/clj/types.rb +0 -3
- metadata +6 -7
data/lib/clj.rb
CHANGED
data/lib/clj/parser.rb
CHANGED
@@ -21,7 +21,7 @@ class Parser
|
|
21
21
|
|
22
22
|
# Unescape characters in strings.
|
23
23
|
UNESCAPE_MAP = Hash.new { |h, k| h[k] = k.chr }
|
24
|
-
UNESCAPE_MAP.
|
24
|
+
UNESCAPE_MAP.merge!(
|
25
25
|
?" => '"',
|
26
26
|
?\\ => '\\',
|
27
27
|
?/ => '/',
|
@@ -30,8 +30,8 @@ class Parser
|
|
30
30
|
?n => "\n",
|
31
31
|
?r => "\r",
|
32
32
|
?t => "\t",
|
33
|
-
?u => nil
|
34
|
-
|
33
|
+
?u => nil
|
34
|
+
)
|
35
35
|
|
36
36
|
EMPTY_8BIT_STRING = ''
|
37
37
|
|
@@ -57,14 +57,14 @@ private
|
|
57
57
|
def next_type (ch)
|
58
58
|
case ch
|
59
59
|
when NUMBERS, '-', '+' then :number
|
60
|
-
when 't', 'f'
|
61
|
-
when 'n'
|
62
|
-
when '\\'
|
63
|
-
when ':'
|
64
|
-
when '"'
|
65
|
-
when '{'
|
66
|
-
when '('
|
67
|
-
when '['
|
60
|
+
when 't', 'f' then :boolean
|
61
|
+
when 'n' then :nil
|
62
|
+
when '\\' then :char
|
63
|
+
when ':' then :keyword
|
64
|
+
when '"' then :string
|
65
|
+
when '{' then :map
|
66
|
+
when '(' then :list
|
67
|
+
when '[' then :vector
|
68
68
|
when '#'
|
69
69
|
case @source.read(1)
|
70
70
|
when 'i' then :instant
|
@@ -342,7 +342,7 @@ private
|
|
342
342
|
end
|
343
343
|
|
344
344
|
def both? (ch)
|
345
|
-
if ch == ' ' || ch == ',' || ch == '"' || ch == '{' || ch == '}' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '#' || ch == "\n" || ch == "\r" || ch == "\t"
|
345
|
+
if ch == ' ' || ch == ',' || ch == '"' || ch == '{' || ch == '}' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '#' || ch == ':' || ch == "\n" || ch == "\r" || ch == "\t"
|
346
346
|
true
|
347
347
|
else
|
348
348
|
false
|
@@ -350,7 +350,7 @@ private
|
|
350
350
|
end
|
351
351
|
|
352
352
|
def keyword? (ch)
|
353
|
-
if ch == ' ' || ch == ',' || ch == '"' || ch == '{' || ch == '}' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '#' || ch == "'" || ch == '^' || ch == '@' || ch == '`' || ch == '~' || ch == '\\' || ch == ';' || ch == "\n" || ch == "\r" || ch == "\t"
|
353
|
+
if ch == ' ' || ch == ',' || ch == '"' || ch == '{' || ch == '}' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '#' || ch == ':' || ch == "'" || ch == '^' || ch == '@' || ch == '`' || ch == '~' || ch == '\\' || ch == ';' || ch == "\n" || ch == "\r" || ch == "\t"
|
354
354
|
true
|
355
355
|
else
|
356
356
|
false
|
data/lib/clj/types.rb
CHANGED
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.5.
|
4
|
+
version: 0.0.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &4605840 !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: *4605840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &4605160 !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: *4605160
|
36
36
|
description:
|
37
37
|
email: meh@paranoici.org
|
38
38
|
executables: []
|
@@ -67,4 +67,3 @@ signing_key:
|
|
67
67
|
specification_version: 3
|
68
68
|
summary: Like json, but with clojure sexps.
|
69
69
|
test_files: []
|
70
|
-
has_rdoc:
|