synvert-core 0.48.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d053ad88384be0c41958704354fff02d9c6d4aba71748ee4a57713e5502eb398
4
- data.tar.gz: f856e276eb76e6cf16f72039bca6ea138b5aae6038c11887f7b81d0128b6a606
3
+ metadata.gz: ff7201f9f25e9092d5bebf6359bf5fb7889d37dae90187666fc208a2a688d01d
4
+ data.tar.gz: 6ff9746cef63978f4cbd62cdc9862dabab9f8ba10512f12bbc1292dda19d6483
5
5
  SHA512:
6
- metadata.gz: b15b022aab4015583b3c9b966b312c9dd3e0a4ecd184c498be19b566b2ef47eaace511ba83f65ecadc70b959fd2d685b1e9ee286bb64f4697016b7c1f5e1040a
7
- data.tar.gz: e62eefc4e31cf53b3b0f7dff13e2909b49db206afea12b82122aae3f7d31037627776d92b8bbf546bb5911b38a0c80b73c5063375399b8b3b61abb519439ae7b
6
+ metadata.gz: e7b44b09b43013829adeb097eafbf143da5d2acbeb731eeb6239388e39dd596c6946ae9cccd91c6e6c9d795bd8118e7a375794f18692461b572bad425b076c9b
7
+ data.tar.gz: 3b14e2a314d04bb0699125c69bef1a5ed46e2ebf79123017c342dccf66ccf6eb1b1f39f27cca3fa817e5eae51ab41d587b606c0a714bd6df1cbb862b3b9e4646
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.49.0 (2021-08-04)
4
+
5
+ * Support :erange in to_value
6
+ * Do not use to_value in match_value?
7
+
3
8
  ## 0.48.0 (2021-08-01)
4
9
 
5
10
  * Force to read file as utf-8
@@ -252,6 +252,8 @@ module Parser::AST
252
252
  children.map(&:to_value)
253
253
  when :irange
254
254
  (children.first.to_value..children.last.to_value)
255
+ when :erange
256
+ (children.first.to_value...children.last.to_value)
255
257
  when :begin
256
258
  children.first.to_value
257
259
  else
@@ -548,14 +550,14 @@ module Parser::AST
548
550
  case expected
549
551
  when Symbol
550
552
  if actual.is_a?(Parser::AST::Node)
551
- actual.to_value == expected
553
+ actual.to_source == ":#{expected}"
552
554
  else
553
555
  actual.to_sym == expected
554
556
  end
555
557
  when String
556
558
  if actual.is_a?(Parser::AST::Node)
557
- actual.to_source == expected || actual.to_value == expected ||
558
- actual.to_source == unwrap_quote(expected) || actual.to_value == unwrap_quote(expected)
559
+ actual.to_source == expected || actual.to_source == unwrap_quote(expected) ||
560
+ unwrap_quote(actual.to_source) == expected || unwrap_quote(actual.to_source) == unwrap_quote(expected)
559
561
  else
560
562
  actual.to_s == expected || wrap_quote(actual.to_s) == expected
561
563
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '0.48.0'
5
+ VERSION = '0.49.0'
6
6
  end
7
7
  end
@@ -316,18 +316,23 @@ describe Parser::AST::Node do
316
316
  expect(node.to_value).to eq :str
317
317
  end
318
318
 
319
- it 'get for boolean' do
319
+ it 'gets for boolean' do
320
320
  node = parse('true')
321
321
  expect(node.to_value).to be_truthy
322
322
  node = parse('false')
323
323
  expect(node.to_value).to be_falsey
324
324
  end
325
325
 
326
- it 'get for range' do
326
+ it 'gets for irange' do
327
327
  node = parse('(1..10)')
328
328
  expect(node.to_value).to eq(1..10)
329
329
  end
330
330
 
331
+ it 'gets for erange' do
332
+ node = parse('(1...10)')
333
+ expect(node.to_value).to eq(1...10)
334
+ end
335
+
331
336
  it 'gets for array' do
332
337
  node = parse("['str', :str]")
333
338
  expect(node.to_value).to eq ['str', :str]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.48.0
4
+ version: 0.49.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-01 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport