synvert-core 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a19f84568d17d7d51bf4f4486a7f95a299261c25eacd5ff57faea07fd597bc26
|
4
|
+
data.tar.gz: 8dce2d09629733e239046581aa03433a7231cf8094ba0e1aec99f1df7ec0f867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a731bae510193fccf6c5682ff7559e7610b7774af5e2d0a196bad1ed838f84c5700e9dfcb123d0314b2ac40034d6246cd676b9e60e01f148ed17e6c32f1bc90
|
7
|
+
data.tar.gz: 15fad0af1dce17af70f2b3a8ab1af3827f57892437076ddda86acdde19f7b24691b05c5c7b064ef33985815e0fdb0eb7fc4ad29924433c955067ee715f302138
|
@@ -33,8 +33,8 @@ class Synvert::Core::NodeQuery::Lexer
|
|
33
33
|
REGEXP = /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
|
34
34
|
SYMBOL = /:[\w!\?<>=]+/
|
35
35
|
TRUE = /true/
|
36
|
-
SINGLE_QUOTE_STRING = /'(
|
37
|
-
DOUBLE_QUOTE_STRING = /"(
|
36
|
+
SINGLE_QUOTE_STRING = /'(.*?)'/
|
37
|
+
DOUBLE_QUOTE_STRING = /"(.*?)"/
|
38
38
|
# :startdoc:
|
39
39
|
# :stopdoc:
|
40
40
|
class LexerError < StandardError ; end
|
data/lib/synvert/core/version.rb
CHANGED
@@ -187,6 +187,19 @@ module Synvert::Core::NodeQuery
|
|
187
187
|
assert_tokens source, expected_tokens
|
188
188
|
end
|
189
189
|
|
190
|
+
it 'matches empty string' do
|
191
|
+
source = ".send[arguments.first='']"
|
192
|
+
expected_tokens = [
|
193
|
+
[:tNODE_TYPE, "send"],
|
194
|
+
[:tOPEN_ATTRIBUTE, "["],
|
195
|
+
[:tKEY, "arguments.first"],
|
196
|
+
[:tEQUAL, "="],
|
197
|
+
[:tSTRING, ""],
|
198
|
+
[:tCLOSE_ATTRIBUTE, "]"]
|
199
|
+
]
|
200
|
+
assert_tokens source, expected_tokens
|
201
|
+
end
|
202
|
+
|
190
203
|
it 'matches attribute value' do
|
191
204
|
source = '.pair[key={{value}}]'
|
192
205
|
expected_tokens = [
|
@@ -108,6 +108,11 @@ module Synvert::Core::NodeQuery
|
|
108
108
|
assert_parser(source)
|
109
109
|
end
|
110
110
|
|
111
|
+
it 'parses empty string' do
|
112
|
+
source = '.send[arguments.first=""]'
|
113
|
+
assert_parser(source)
|
114
|
+
end
|
115
|
+
|
111
116
|
describe '#query_nodes' do
|
112
117
|
let(:node) {
|
113
118
|
parse(<<~EOS)
|