wirb 0.3.0 → 0.3.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/CHANGELOG.rdoc +3 -0
- data/lib/wirb/tokenizer.rb +8 -3
- data/lib/wirb/version.rb +1 -1
- data/spec/tokenizer_symbol_spec.rb +13 -1
- metadata +1 -1
data/CHANGELOG.rdoc
CHANGED
data/lib/wirb/tokenizer.rb
CHANGED
@@ -154,9 +154,12 @@ class << Wirb
|
|
154
154
|
when :symbol
|
155
155
|
case c
|
156
156
|
when /"/
|
157
|
-
|
158
|
-
|
159
|
-
|
157
|
+
if lc == '$' && llc == ':'
|
158
|
+
@token << c
|
159
|
+
else
|
160
|
+
pass[:symbol_prefix, ':']
|
161
|
+
set_state[:symbol_string]
|
162
|
+
end
|
160
163
|
when /[^"., }\])=]/
|
161
164
|
@token << c
|
162
165
|
else
|
@@ -164,6 +167,8 @@ class << Wirb
|
|
164
167
|
@token << c
|
165
168
|
elsif c == '=' && nc != '>' # FIXME: spaceship error
|
166
169
|
@token << c
|
170
|
+
elsif c =~ /[.,]/ && lc == '$' && llc == ':'
|
171
|
+
@token << c
|
167
172
|
else
|
168
173
|
pass[:symbol_prefix, ':']
|
169
174
|
pass_state[:remove, :repeat]
|
data/lib/wirb/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
describe tokenizer(__FILE__) do
|
2
2
|
after :each do check_value end
|
3
3
|
|
4
|
-
please do check %w|a ab ab0 ab= < > * + <=> <= >= == =~ __send__ is_a? [] []=
|
4
|
+
please do check %w|a ab ab0 ab= < > * + <=> <= >= == =~ __send__ is_a? [] []= $. $" $,|.map(&:to_sym)
|
5
5
|
tokens.should == [
|
6
6
|
[:open_array, "["],
|
7
7
|
[:symbol_prefix, ":"],
|
@@ -72,6 +72,18 @@ describe tokenizer(__FILE__) do
|
|
72
72
|
[:whitespace, " "],
|
73
73
|
[:symbol_prefix, ":"],
|
74
74
|
[:symbol, "[]="],
|
75
|
+
[:comma, ","],
|
76
|
+
[:whitespace, " "],
|
77
|
+
[:symbol_prefix, ":"],
|
78
|
+
[:symbol, "$."],
|
79
|
+
[:comma, ","],
|
80
|
+
[:whitespace, " "],
|
81
|
+
[:symbol_prefix, ":"],
|
82
|
+
[:symbol, "$\""],
|
83
|
+
[:comma, ","],
|
84
|
+
[:whitespace, " "],
|
85
|
+
[:symbol_prefix, ":"],
|
86
|
+
[:symbol, "$,"],
|
75
87
|
[:close_array, "]"],
|
76
88
|
]
|
77
89
|
end
|