bindy 0.0.3 → 0.0.4

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: 6490af3e06014b76edef51e39d09174586b6f343
4
- data.tar.gz: 480b76ff73c5623d6c74f475d7b048a3d61c9c69
3
+ metadata.gz: af9b60c22dd2e77d0eb7e1f88ecf7d6a2fa15c3f
4
+ data.tar.gz: 05380aed76274aedfca2f5980976de0f710d627b
5
5
  SHA512:
6
- metadata.gz: 21a67be2837f3674bd00e791f04ce01f410d6b3bac17e4b748f81e51ba22da1836deb732577c825c13bd1847700ad5c3fceba6ea8acecbd10c5ae14537917bcd
7
- data.tar.gz: 07cd9b13be0152ac0d259fd8452fe3039ccb157bf0ce698e83e438df8b87bde621b97c56deec1e312741e178700fdda682cd13f0b330f4a483934dee8ed71fb9
6
+ metadata.gz: e66b3265231ff1c30d8db200fab24059431b29c400e6a231b7401dd03d020e1ace33eca8fbaafe27a7dc4afbbec486a6b136fc86c3ac79662655d5ddd00d73b4
7
+ data.tar.gz: 2e188931eab3cab13250541c6906c075176bb91435a93877101272d452509080a7b2461d9a80e434b2546dac4456992831e00db85179e4ef4195933bacf5586a
@@ -4,4 +4,7 @@ rvm:
4
4
  - 2.0
5
5
  - 2.1
6
6
  - 2.2
7
- - jruby
7
+ - 2.3.0
8
+ - jruby
9
+ before_install:
10
+ - gem install bundler
@@ -313,8 +313,14 @@ module Bindy
313
313
  r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
314
314
  r0 = r3
315
315
  else
316
- @index = i0
317
- r0 = nil
316
+ r4 = _nt_null
317
+ if r4
318
+ r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
319
+ r0 = r4
320
+ else
321
+ @index = i0
322
+ r0 = nil
323
+ end
318
324
  end
319
325
  end
320
326
  end
@@ -669,6 +675,30 @@ module Bindy
669
675
  r0
670
676
  end
671
677
 
678
+ def _nt_null
679
+ start_index = index
680
+ if node_cache[:null].has_key?(index)
681
+ cached = node_cache[:null][index]
682
+ if cached
683
+ node_cache[:null][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
684
+ @index = cached.interval.end
685
+ end
686
+ return cached
687
+ end
688
+
689
+ if (match_len = has_terminal?('null', false, index))
690
+ r0 = instantiate_node(LiteralNull,input, index...(index + match_len))
691
+ @index += match_len
692
+ else
693
+ terminal_parse_failure('\'null\'')
694
+ r0 = nil
695
+ end
696
+
697
+ node_cache[:null][start_index] = r0
698
+
699
+ r0
700
+ end
701
+
672
702
  def _nt_space
673
703
  start_index = index
674
704
  if node_cache[:space].has_key?(index)
@@ -20,7 +20,7 @@ module Bindy
20
20
  end
21
21
 
22
22
  rule value
23
- number / boolean / string
23
+ number / boolean / string / null
24
24
  end
25
25
 
26
26
  rule string
@@ -51,6 +51,10 @@ module Bindy
51
51
  'false' <LiteralFalse>
52
52
  end
53
53
 
54
+ rule null
55
+ 'null' <LiteralNull>
56
+ end
57
+
54
58
  rule space
55
59
  [\s\t\n]
56
60
  end
@@ -73,5 +73,11 @@ module Bindy
73
73
  end
74
74
  end
75
75
 
76
+ class LiteralNull < Treetop::Runtime::SyntaxNode
77
+ def evaluate(context)
78
+ nil
79
+ end
80
+ end
81
+
76
82
  end
77
83
  end
@@ -1,3 +1,3 @@
1
1
  module Bindy
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bindy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-27 00:00:00.000000000 Z
11
+ date: 2016-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: treetop
@@ -152,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.4.7
155
+ rubygems_version: 2.4.8
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Context binding for functions evaluation