synvert-core 1.0.1 → 1.0.2

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: f889cb977b7bf6e847bdeeac011ee0d23210ae8db7a0652e8c00d5d98c72a701
4
- data.tar.gz: 46d220401cc8c9c0422428c2915862148b4ad8dc236f637ed52dbc45207de742
3
+ metadata.gz: ab495ff09805562a46b2d6aefe872af0a6970b7759e89a4dc5b2d682bb291698
4
+ data.tar.gz: aefd9db248d21de0f84f437e5657b13750302060f4226eec6d24649ee8d63bb6
5
5
  SHA512:
6
- metadata.gz: 926df3dd8aa3689938e90c530fb432e0703cff2f89f35f46950b3630eb98b8da6de0e0d5eb75c5c24262f3712400d4570ac05abd5ebbbe6c6954d6c997048432
7
- data.tar.gz: 321fb626763ca31e6156c462bb6846ce73d00639a620b0b7048b024fbe50d14f63f6d3209e3a534b0475c29c29e74dcf0a7c204f14ad0927244bd5cbb157b3d6
6
+ metadata.gz: 3627ac9446c98f8b37915ba2a62909000bb378ecba1630864f1876bc9549cc67d96217a6787554ad7a8671d482f402576b3943183c8e575e3dfd4791feaeea22
7
+ data.tar.gz: 80febc0c3ee86be36bfb81f19a4fad61d390d1b971d8d4895fa23e7ce07b3cdfa599276f5a82a155fa52047fdc9a2139b02354d6e3152dc57085579831ab8aaa
@@ -11,7 +11,7 @@ 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+/
@@ -24,7 +24,7 @@ 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+/
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.2'
6
6
  end
7
7
  end
@@ -139,6 +139,19 @@ module Synvert::Core::NodeQuery
139
139
  assert_tokens source, expected_tokens
140
140
  end
141
141
 
142
+ it 'identifier can contain ?' do
143
+ source = '.send[message=empty?]'
144
+ expected_tokens = [
145
+ [:tNODE_TYPE, "send"],
146
+ [:tOPEN_ATTRIBUTE, "["],
147
+ [:tKEY, "message"],
148
+ [:tEQUAL, "="],
149
+ [:tIDENTIFIER_VALUE, "empty?"],
150
+ [:tCLOSE_ATTRIBUTE, "]"]
151
+ ]
152
+ assert_tokens source, expected_tokens
153
+ end
154
+
142
155
  it 'matches attribute value' do
143
156
  source = '.pair[key={{value}}]'
144
157
  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.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang