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: ab495ff09805562a46b2d6aefe872af0a6970b7759e89a4dc5b2d682bb291698
4
- data.tar.gz: aefd9db248d21de0f84f437e5657b13750302060f4226eec6d24649ee8d63bb6
3
+ metadata.gz: 2e678636827f8ffcad275fe7c6e6bcbee9d278a954bf33a80822ff7235944469
4
+ data.tar.gz: fa6c7ad36ed9fa50901f4b6f9f373190aa3ad0cbba4bdea539daf66376bc6e0c
5
5
  SHA512:
6
- metadata.gz: 3627ac9446c98f8b37915ba2a62909000bb378ecba1630864f1876bc9549cc67d96217a6787554ad7a8671d482f402576b3943183c8e575e3dfd4791feaeea22
7
- data.tar.gz: 80febc0c3ee86be36bfb81f19a4fad61d390d1b971d8d4895fa23e7ce07b3cdfa599276f5a82a155fa52047fdc9a2139b02354d6e3152dc57085579831ab8aaa
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 = /"(.+?)"/
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.0.2'
5
+ VERSION = '1.0.3'
6
6
  end
7
7
  end
@@ -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 = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang