synvert-core 1.0.2 → 1.0.3
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: 2e678636827f8ffcad275fe7c6e6bcbee9d278a954bf33a80822ff7235944469
|
4
|
+
data.tar.gz: fa6c7ad36ed9fa50901f4b6f9f373190aa3ad0cbba4bdea539daf66376bc6e0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd53c12635ecb49e6d2c6b43d8a0513ac0fd2c2c0b6de8081bc30318512ae7714c092c2e36a721059b2ec811ec521757a1b32889d2e6ff4cb516ce83877cfef6
|
7
|
+
data.tar.gz: 4a0e169b94bc54a61e944d3e44d5bd40a884783c73c2ad491dbb23a25c77c73bb2e120f0feb61494a8bf8762c234cbc3d983185e0bc2eb18a6ec8cb3d2c933ab
|
@@ -11,14 +11,14 @@ macros
|
|
11
11
|
CLOSE_DYNAMIC_ATTRIBUTE /}}/
|
12
12
|
NODE_TYPE /\.[a-z]+/
|
13
13
|
IDENTIFIER /[\.\w]+/
|
14
|
-
IDENTIFIER_VALUE /[\.\w
|
14
|
+
IDENTIFIER_VALUE /[\.\w!&:\?<>=]+/
|
15
15
|
FALSE /false/
|
16
16
|
FLOAT /\d+\.\d+/
|
17
17
|
INTEGER /\d+/
|
18
18
|
NIL /nil/
|
19
19
|
REGEXP_BODY /(?:[^\/]|\\\/)*/
|
20
20
|
REGEXP /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
|
21
|
-
SYMBOL /:[\w
|
21
|
+
SYMBOL /:[\w!\?<>=]+/
|
22
22
|
TRUE /true/
|
23
23
|
SINGLE_QUOTE_STRING /'(.+?)'/
|
24
24
|
DOUBLE_QUOTE_STRING /"(.+?)"/
|
@@ -24,14 +24,14 @@ class Synvert::Core::NodeQuery::Lexer
|
|
24
24
|
CLOSE_DYNAMIC_ATTRIBUTE = /}}/
|
25
25
|
NODE_TYPE = /\.[a-z]+/
|
26
26
|
IDENTIFIER = /[\.\w]+/
|
27
|
-
IDENTIFIER_VALUE = /[\.\w
|
27
|
+
IDENTIFIER_VALUE = /[\.\w!&:\?<>=]+/
|
28
28
|
FALSE = /false/
|
29
29
|
FLOAT = /\d+\.\d+/
|
30
30
|
INTEGER = /\d+/
|
31
31
|
NIL = /nil/
|
32
32
|
REGEXP_BODY = /(?:[^\/]|\\\/)*/
|
33
33
|
REGEXP = /\/(#{REGEXP_BODY})(?<!\\)\/([imxo]*)/
|
34
|
-
SYMBOL = /:[\w
|
34
|
+
SYMBOL = /:[\w!\?<>=]+/
|
35
35
|
TRUE = /true/
|
36
36
|
SINGLE_QUOTE_STRING = /'(.+?)'/
|
37
37
|
DOUBLE_QUOTE_STRING = /"(.+?)"/
|
data/lib/synvert/core/version.rb
CHANGED
@@ -152,6 +152,19 @@ module Synvert::Core::NodeQuery
|
|
152
152
|
assert_tokens source, expected_tokens
|
153
153
|
end
|
154
154
|
|
155
|
+
it 'identifier can contain <, >, =' do
|
156
|
+
source = '.send[message=<=>]'
|
157
|
+
expected_tokens = [
|
158
|
+
[:tNODE_TYPE, "send"],
|
159
|
+
[:tOPEN_ATTRIBUTE, "["],
|
160
|
+
[:tKEY, "message"],
|
161
|
+
[:tEQUAL, "="],
|
162
|
+
[:tIDENTIFIER_VALUE, "<=>"],
|
163
|
+
[:tCLOSE_ATTRIBUTE, "]"]
|
164
|
+
]
|
165
|
+
assert_tokens source, expected_tokens
|
166
|
+
end
|
167
|
+
|
155
168
|
it 'matches attribute value' do
|
156
169
|
source = '.pair[key={{value}}]'
|
157
170
|
expected_tokens = [
|