synvert-core 1.0.3 → 1.0.4

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: 2e678636827f8ffcad275fe7c6e6bcbee9d278a954bf33a80822ff7235944469
4
- data.tar.gz: fa6c7ad36ed9fa50901f4b6f9f373190aa3ad0cbba4bdea539daf66376bc6e0c
3
+ metadata.gz: e0554ef349e1fe725c68cd277b40751ca7373b04fe118313bf70fdf307852e01
4
+ data.tar.gz: 283a4ca6bf2d0fc09ba1f63bb5831524dc0634184072c340d7092a9253a93700
5
5
  SHA512:
6
- metadata.gz: bd53c12635ecb49e6d2c6b43d8a0513ac0fd2c2c0b6de8081bc30318512ae7714c092c2e36a721059b2ec811ec521757a1b32889d2e6ff4cb516ce83877cfef6
7
- data.tar.gz: 4a0e169b94bc54a61e944d3e44d5bd40a884783c73c2ad491dbb23a25c77c73bb2e120f0feb61494a8bf8762c234cbc3d983185e0bc2eb18a6ec8cb3d2c933ab
6
+ metadata.gz: 9152e5eea03cbc9a842fdad557cc8ea9ecb2e7d3dc3480708b886100393c0167a804f3cd0f4fd5aca968c4992ce85b0b604d36ab6beabe9ac4023e6102e2c05e
7
+ data.tar.gz: 4b35baab2ebe3c76a9151e0148dc185a8e6776d4dd6ece7abcd2cb3cd4ad21bc63b5cc68b75d6410827ef9089bf52fc6871bacb1e44c39cffce36faef07b9a8f
@@ -66,9 +66,6 @@ rules
66
66
  :VALUE /#{DOUBLE_QUOTE_STRING}/ { [:tSTRING, text[1...-1]] }
67
67
  :VALUE /#{SINGLE_QUOTE_STRING}/ { [:tSTRING, text[1...-1]] }
68
68
  :VALUE /#{NODE_TYPE}/ { [:tNODE_TYPE, text[1..]] }
69
- :VALUE />/ { [:tCHILD, text] }
70
- :VALUE /~/ { [:tSUBSEQUENT_SIBLING, text] }
71
- :VALUE /\+/ { [:tNEXT_SIBLING, text] }
72
69
  :VALUE /#{OPEN_ATTRIBUTE}/ { @nested_count += 1; @state = :KEY; [:tOPEN_ATTRIBUTE, text] }
73
70
  :VALUE /#{IDENTIFIER_VALUE}/ { [:tIDENTIFIER_VALUE, text] }
74
71
  :DYNAMIC_ATTRIBUTE /#{CLOSE_DYNAMIC_ATTRIBUTE}/ { @state = :VALUE; [:tCLOSE_DYNAMIC_ATTRIBUTE, text] }
@@ -215,12 +215,6 @@ class Synvert::Core::NodeQuery::Lexer
215
215
  action { [:tSTRING, text[1...-1]] }
216
216
  when text = ss.scan(/#{NODE_TYPE}/) then
217
217
  action { [:tNODE_TYPE, text[1..]] }
218
- when text = ss.scan(/>/) then
219
- action { [:tCHILD, text] }
220
- when text = ss.scan(/~/) then
221
- action { [:tSUBSEQUENT_SIBLING, text] }
222
- when text = ss.scan(/\+/) then
223
- action { [:tNEXT_SIBLING, text] }
224
218
  when text = ss.scan(/#{OPEN_ATTRIBUTE}/) then
225
219
  action { @nested_count += 1; @state = :KEY; [:tOPEN_ATTRIBUTE, text] }
226
220
  when text = ss.scan(/#{IDENTIFIER_VALUE}/) then
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.0.3'
5
+ VERSION = '1.0.4'
6
6
  end
7
7
  end
@@ -153,13 +153,35 @@ module Synvert::Core::NodeQuery
153
153
  end
154
154
 
155
155
  it 'identifier can contain <, >, =' do
156
- source = '.send[message=<=>]'
156
+ source = '.send[message=<]'
157
157
  expected_tokens = [
158
158
  [:tNODE_TYPE, "send"],
159
159
  [:tOPEN_ATTRIBUTE, "["],
160
160
  [:tKEY, "message"],
161
161
  [:tEQUAL, "="],
162
- [:tIDENTIFIER_VALUE, "<=>"],
162
+ [:tIDENTIFIER_VALUE, "<"],
163
+ [:tCLOSE_ATTRIBUTE, "]"]
164
+ ]
165
+ assert_tokens source, expected_tokens
166
+
167
+ source = '.send[message==]'
168
+ expected_tokens = [
169
+ [:tNODE_TYPE, "send"],
170
+ [:tOPEN_ATTRIBUTE, "["],
171
+ [:tKEY, "message"],
172
+ [:tEQUAL, "="],
173
+ [:tIDENTIFIER_VALUE, "="],
174
+ [:tCLOSE_ATTRIBUTE, "]"]
175
+ ]
176
+ assert_tokens source, expected_tokens
177
+
178
+ source = '.send[message=>]'
179
+ expected_tokens = [
180
+ [:tNODE_TYPE, "send"],
181
+ [:tOPEN_ATTRIBUTE, "["],
182
+ [:tKEY, "message"],
183
+ [:tEQUAL, "="],
184
+ [:tIDENTIFIER_VALUE, ">"],
163
185
  [:tCLOSE_ATTRIBUTE, "]"]
164
186
  ]
165
187
  assert_tokens source, 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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang