rsec 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: 904dd497bc983a4efa03ccb5a3dd76e5bbbf568d
4
- data.tar.gz: 22dc385a08a755fe88bc02da728eb701210de50b
3
+ metadata.gz: 23d745b038736c185b7a9159a77477ae93cb5e40
4
+ data.tar.gz: 9b8a26991ce589d93503450c851cdabda83d342e
5
5
  SHA512:
6
- metadata.gz: 083bc5dc382ce0fc36d083067e372c9a14090518fcc2daf4af06c396ee072b8187b37a90e5740960d8b85126f658f3855ba48f6b1a774852af29008b8543b4d4
7
- data.tar.gz: 5f855f5be431184de7087e19d65258f72107bd2d3176c98148d5d4081f907109c31cd8f3078b20441ee5b3dcdf05ffffe98d1fa39e0b76ae33ee6085cd85a5ee
6
+ metadata.gz: 6f23ad71fc0ac0fa8619630f7c636037ad4cd0e759d7e059ee9b9f2dfa18d2f482b0bf10dd0687e809a3e0fecff242d9d5018d7ca9e696e5de310785429738b0
7
+ data.tar.gz: edc0398eaae5e0e2997310f561811d7679e718f1df3c371dd78ba76d52ba629163817f2c02758969f9a6442f57f76997e1b3f39a70f89acb1e20e84dd71fd360
@@ -11,7 +11,7 @@ module Rsec
11
11
  TO_PARSER_METHOD = :r
12
12
  end
13
13
 
14
- VERSION = '0.4.1'
14
+ VERSION = '0.4.2'
15
15
  end
16
16
 
17
17
  require "strscan"
@@ -64,10 +64,9 @@ module Rsec #:nodoc
64
64
  def _parse ctx
65
65
  res = left()._parse ctx
66
66
  pos = ctx.pos
67
- if INVALID[right()._parse ctx]
68
- ctx.pos = pos
69
- res
70
- end
67
+ return INVALID unless INVALID[right()._parse ctx]
68
+ ctx.pos = pos
69
+ res
71
70
  end
72
71
  end
73
72
 
@@ -13,4 +13,10 @@ class TestLookAhead < TC
13
13
  ase ['a', 'c'], p.parse('ac')
14
14
  ase INVALID, p.parse('ab')
15
15
  end
16
+
17
+ def test_negative_lookahead
18
+ p = 'a'.r ^ 'b'
19
+ ase 'a', p.parse('ac')
20
+ ase INVALID, p.parse('ab')
21
+ end
16
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - NS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-16 00:00:00.000000000 Z
11
+ date: 2016-09-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Easy and extreme fast dynamic PEG parser combinator.
14
14
  email:
@@ -71,8 +71,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  requirements: []
73
73
  rubyforge_project:
74
- rubygems_version: 2.2.0
74
+ rubygems_version: 2.5.1
75
75
  signing_key:
76
- specification_version: 3
76
+ specification_version: 4
77
77
  summary: Extreme Fast Parser Combinator for Ruby
78
78
  test_files: []