edn-abnf 0.3.4 → 0.3.5

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: be3442eabfe91c73cff8572576b27a53fb84ac50e55e3063c883de6016b11a1a
4
- data.tar.gz: 163f0500284e03ec64631fe608c2664b6450056b954d8d9a59b8531dad30274a
3
+ metadata.gz: f27ae567e340f8f491fd48f61ffcf98080e5a7e25f73e48178ba716382976232
4
+ data.tar.gz: 911714cd26c0f5fc215d75bf29f95bb17bb8f7e20b1c89897e2bbdc919047366
5
5
  SHA512:
6
- metadata.gz: 514a619e123731703f5a8e126583c5d6ba6d501b25932dd049379f3328aba79f07be153df04a0a8aec7fd82f694dc60b57fb4d0d41e4f888a442ac74bbb2f563
7
- data.tar.gz: 0cf73998452ca7f667003079252bd85c2a3f549eb33ec4a1b4a259be63b92e9cce9da01c738994cf99d0968d71845d737ef530abb2d157243106b72133050092
6
+ metadata.gz: adf381d82f725bbcf8f2fcc67bdcf57d999ba236bc6d3f4aae062cc85c0c189770662bb38916134a4e0d5d7a73ed1fa1e0a604cfe39f9f0f29ca34a4102e423b
7
+ data.tar.gz: 4edde63c1bd6aac32b14d3c5bf118e43e8d26dd77cc7e4653ec5304699e6341b7e885e96b4afeb7dce3c8f628d07d2f405a85fff24aaa7dfc5324271264c42b3
data/edn-abnf.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "edn-abnf"
3
- s.version = "0.3.4"
3
+ s.version = "0.3.5"
4
4
  s.summary = "CBOR Extended Diagnostic Notation (EDN) implemented in ABNF"
5
5
  s.description = %q{edn-abnf implements converters and miscellaneous tools for CBOR EDN's ABNF}
6
6
  s.author = "Carsten Bormann"
@@ -1757,6 +1757,13 @@ module EDNGRAMMAR
1757
1757
  end
1758
1758
 
1759
1759
  module Sqstr0
1760
+ def SQUOTE1
1761
+ elements[0]
1762
+ end
1763
+
1764
+ def SQUOTE2
1765
+ elements[2]
1766
+ end
1760
1767
  end
1761
1768
 
1762
1769
  module Sqstr1
@@ -1777,13 +1784,7 @@ module EDNGRAMMAR
1777
1784
  end
1778
1785
 
1779
1786
  i0, s0 = index, []
1780
- if (match_len = has_terminal?("'", false, index))
1781
- r1 = true
1782
- @index += match_len
1783
- else
1784
- terminal_parse_failure('"\'"')
1785
- r1 = nil
1786
- end
1787
+ r1 = _nt_SQUOTE
1787
1788
  s0 << r1
1788
1789
  if r1
1789
1790
  s2, i2 = [], index
@@ -1798,13 +1799,7 @@ module EDNGRAMMAR
1798
1799
  r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
1799
1800
  s0 << r2
1800
1801
  if r2
1801
- if (match_len = has_terminal?("'", false, index))
1802
- r4 = true
1803
- @index += match_len
1804
- else
1805
- terminal_parse_failure('"\'"')
1806
- r4 = nil
1807
- end
1802
+ r4 = _nt_SQUOTE
1808
1803
  s0 << r4
1809
1804
  end
1810
1805
  end
@@ -3067,14 +3062,9 @@ module EDNGRAMMAR
3067
3062
  r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
3068
3063
  r0 = r1
3069
3064
  else
3070
- if (match_len = has_terminal?("'", false, index))
3071
- r2 = instantiate_node(SyntaxNode,input, index...(index + match_len))
3072
- r2.extend(DoubleQuoted1)
3073
- @index += match_len
3074
- else
3075
- terminal_parse_failure('"\'"')
3076
- r2 = nil
3077
- end
3065
+ r2 = _nt_SQUOTE
3066
+ r2.extend(DoubleQuoted1)
3067
+ r2.extend(DoubleQuoted1)
3078
3068
  if r2
3079
3069
  r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
3080
3070
  r0 = r2
@@ -3150,6 +3140,9 @@ module EDNGRAMMAR
3150
3140
  end
3151
3141
 
3152
3142
  module SingleQuoted2
3143
+ def SQUOTE
3144
+ elements[1]
3145
+ end
3153
3146
  end
3154
3147
 
3155
3148
  module SingleQuoted3
@@ -3202,13 +3195,7 @@ module EDNGRAMMAR
3202
3195
  end
3203
3196
  s3 << r4
3204
3197
  if r4
3205
- if (match_len = has_terminal?("'", false, index))
3206
- r5 = true
3207
- @index += match_len
3208
- else
3209
- terminal_parse_failure('"\'"')
3210
- r5 = nil
3211
- end
3198
+ r5 = _nt_SQUOTE
3212
3199
  s3 << r5
3213
3200
  end
3214
3201
  if s3.last
@@ -4319,6 +4306,30 @@ module EDNGRAMMAR
4319
4306
  r0
4320
4307
  end
4321
4308
 
4309
+ def _nt_SQUOTE
4310
+ start_index = index
4311
+ if node_cache[:SQUOTE].has_key?(index)
4312
+ cached = node_cache[:SQUOTE][index]
4313
+ if cached
4314
+ node_cache[:SQUOTE][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
4315
+ @index = cached.interval.end
4316
+ end
4317
+ return cached
4318
+ end
4319
+
4320
+ if (match_len = has_terminal?("'", false, index))
4321
+ r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
4322
+ @index += match_len
4323
+ else
4324
+ terminal_parse_failure('"\'"')
4325
+ r0 = nil
4326
+ end
4327
+
4328
+ node_cache[:SQUOTE][start_index] = r0
4329
+
4330
+ r0
4331
+ end
4332
+
4322
4333
  def _nt_DIGIT
4323
4334
  start_index = index
4324
4335
  if node_cache[:DIGIT].has_key?(index)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn-abnf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-01-05 00:00:00.000000000 Z
11
+ date: 2025-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler