edn-abnf 0.5.3 → 0.5.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
  SHA256:
3
- metadata.gz: 993acf6aae5ce078aec90f346fa8a0a313b33d3af4ef16661fdc6c3d31def17c
4
- data.tar.gz: a8504ae9093db0b806ecaec245a8ddee7d9cdabbdace99e12ee9e7240ea35fbe
3
+ metadata.gz: 922ecd2d704ac04d4e5528eb69a1f0db417783db1919f4da4defb1292639b4bb
4
+ data.tar.gz: bd1cc06141be181acd59f63b15496c390dd9f6e522fc8586f7f92a6b43a8f34e
5
5
  SHA512:
6
- metadata.gz: 41632492c3f64d9bec1f80db81318d7b0efa35fd9f57e2e12e5bb3f57ced8877a7bb453f1d9d8fd3aea7bb6cd40a95a35ae205f21ec89fa6ebe47a5d01b6daf0
7
- data.tar.gz: e0ecb22948210d10f00782f94d4e558b3acdd1f9c63625643cffaad17f8b02e1863d1578e13f5b67ca0abcfa44c0f41f951ed622a86033aaf9aa2dd6942bf63b
6
+ metadata.gz: 85e253915ca89b58db123872902d38c208064d4f71b808381129ac6b177e3d603d1731dc86721b224388a9ab1de76af113dca1ce75147c84353ca14bdc1f310f
7
+ data.tar.gz: 78885798497255c6530f96fd048fb2f48fcbe4d6cadceaee2c8b8aa117a460bdba9041d6473a08382323d1fb1f2a084a75ac613df5eb3ead22322419336c32c9
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.5.3"
3
+ s.version = "0.5.4"
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"
@@ -1624,7 +1624,7 @@ module EDNGRAMMAR
1624
1624
  if r2
1625
1625
  s3, i3 = [], index
1626
1626
  loop do
1627
- r4 = _nt_lcalnum
1627
+ r4 = _nt_lcldh
1628
1628
  if r4
1629
1629
  s3 << r4
1630
1630
  else
@@ -1651,7 +1651,7 @@ module EDNGRAMMAR
1651
1651
  if r6
1652
1652
  s7, i7 = [], index
1653
1653
  loop do
1654
- r8 = _nt_ucalnum
1654
+ r8 = _nt_ucldh
1655
1655
  if r8
1656
1656
  s7 << r8
1657
1657
  else
@@ -1882,28 +1882,34 @@ module EDNGRAMMAR
1882
1882
  r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
1883
1883
  r0 = r1
1884
1884
  else
1885
- r2 = _nt_app_string
1885
+ r2 = _nt_sq_app_string_b64
1886
1886
  if r2
1887
1887
  r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
1888
1888
  r0 = r2
1889
1889
  else
1890
- r3 = _nt_sqstr
1890
+ r3 = _nt_app_string
1891
1891
  if r3
1892
1892
  r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
1893
1893
  r0 = r3
1894
1894
  else
1895
- r4 = _nt_app_sequence
1895
+ r4 = _nt_sqstr
1896
1896
  if r4
1897
1897
  r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
1898
1898
  r0 = r4
1899
1899
  else
1900
- r5 = _nt_embedded
1900
+ r5 = _nt_app_sequence
1901
1901
  if r5
1902
1902
  r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
1903
1903
  r0 = r5
1904
1904
  else
1905
- @index = i0
1906
- r0 = nil
1905
+ r6 = _nt_embedded
1906
+ if r6
1907
+ r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
1908
+ r0 = r6
1909
+ else
1910
+ @index = i0
1911
+ r0 = nil
1912
+ end
1907
1913
  end
1908
1914
  end
1909
1915
  end
@@ -5740,12 +5746,12 @@ module EDNGRAMMAR
5740
5746
  r0
5741
5747
  end
5742
5748
 
5743
- def _nt_lcalnum
5749
+ def _nt_lcldh
5744
5750
  start_index = index
5745
- if node_cache[:lcalnum].has_key?(index)
5746
- cached = node_cache[:lcalnum][index]
5751
+ if node_cache[:lcldh].has_key?(index)
5752
+ cached = node_cache[:lcldh][index]
5747
5753
  if cached
5748
- node_cache[:lcalnum][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
5754
+ node_cache[:lcldh][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
5749
5755
  @index = cached.interval.end
5750
5756
  end
5751
5757
  return cached
@@ -5762,12 +5768,24 @@ module EDNGRAMMAR
5762
5768
  r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
5763
5769
  r0 = r2
5764
5770
  else
5765
- @index = i0
5766
- r0 = nil
5771
+ if (match_len = has_terminal?("-", false, index))
5772
+ r3 = true
5773
+ @index += match_len
5774
+ else
5775
+ terminal_parse_failure('"-"')
5776
+ r3 = nil
5777
+ end
5778
+ if r3
5779
+ r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
5780
+ r0 = r3
5781
+ else
5782
+ @index = i0
5783
+ r0 = nil
5784
+ end
5767
5785
  end
5768
5786
  end
5769
5787
 
5770
- node_cache[:lcalnum][start_index] = r0
5788
+ node_cache[:lcldh][start_index] = r0
5771
5789
 
5772
5790
  r0
5773
5791
  end
@@ -5796,12 +5814,12 @@ module EDNGRAMMAR
5796
5814
  r0
5797
5815
  end
5798
5816
 
5799
- def _nt_ucalnum
5817
+ def _nt_ucldh
5800
5818
  start_index = index
5801
- if node_cache[:ucalnum].has_key?(index)
5802
- cached = node_cache[:ucalnum][index]
5819
+ if node_cache[:ucldh].has_key?(index)
5820
+ cached = node_cache[:ucldh][index]
5803
5821
  if cached
5804
- node_cache[:ucalnum][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
5822
+ node_cache[:ucldh][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
5805
5823
  @index = cached.interval.end
5806
5824
  end
5807
5825
  return cached
@@ -5814,6 +5832,50 @@ module EDNGRAMMAR
5814
5832
  r0 = r1
5815
5833
  else
5816
5834
  r2 = _nt_DIGIT
5835
+ if r2
5836
+ r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
5837
+ r0 = r2
5838
+ else
5839
+ if (match_len = has_terminal?("-", false, index))
5840
+ r3 = true
5841
+ @index += match_len
5842
+ else
5843
+ terminal_parse_failure('"-"')
5844
+ r3 = nil
5845
+ end
5846
+ if r3
5847
+ r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
5848
+ r0 = r3
5849
+ else
5850
+ @index = i0
5851
+ r0 = nil
5852
+ end
5853
+ end
5854
+ end
5855
+
5856
+ node_cache[:ucldh][start_index] = r0
5857
+
5858
+ r0
5859
+ end
5860
+
5861
+ def _nt_ALPHA
5862
+ start_index = index
5863
+ if node_cache[:ALPHA].has_key?(index)
5864
+ cached = node_cache[:ALPHA][index]
5865
+ if cached
5866
+ node_cache[:ALPHA][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
5867
+ @index = cached.interval.end
5868
+ end
5869
+ return cached
5870
+ end
5871
+
5872
+ i0 = index
5873
+ r1 = _nt_lcalpha
5874
+ if r1
5875
+ r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
5876
+ r0 = r1
5877
+ else
5878
+ r2 = _nt_ucalpha
5817
5879
  if r2
5818
5880
  r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
5819
5881
  r0 = r2
@@ -5823,7 +5885,7 @@ module EDNGRAMMAR
5823
5885
  end
5824
5886
  end
5825
5887
 
5826
- node_cache[:ucalnum][start_index] = r0
5888
+ node_cache[:ALPHA][start_index] = r0
5827
5889
 
5828
5890
  r0
5829
5891
  end
@@ -5851,18 +5913,24 @@ module EDNGRAMMAR
5851
5913
  r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
5852
5914
  r0 = r1
5853
5915
  else
5854
- r2 = _nt_lcalnum
5916
+ r2 = _nt_lcalpha
5855
5917
  if r2
5856
5918
  r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
5857
5919
  r0 = r2
5858
5920
  else
5859
- r3 = _nt_ucalpha
5921
+ r3 = _nt_DIGIT
5860
5922
  if r3
5861
5923
  r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
5862
5924
  r0 = r3
5863
5925
  else
5864
- @index = i0
5865
- r0 = nil
5926
+ r4 = _nt_ucalpha
5927
+ if r4
5928
+ r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
5929
+ r0 = r4
5930
+ else
5931
+ @index = i0
5932
+ r0 = nil
5933
+ end
5866
5934
  end
5867
5935
  end
5868
5936
  end
@@ -6321,6 +6389,148 @@ module EDNGRAMMAR
6321
6389
  r0
6322
6390
  end
6323
6391
 
6392
+ def _nt_i_blank
6393
+ start_index = index
6394
+ if node_cache[:i_blank].has_key?(index)
6395
+ cached = node_cache[:i_blank][index]
6396
+ if cached
6397
+ node_cache[:i_blank][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
6398
+ @index = cached.interval.end
6399
+ end
6400
+ return cached
6401
+ end
6402
+
6403
+ i0 = index
6404
+ r1 = _nt_i_LF
6405
+ if r1
6406
+ r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
6407
+ r0 = r1
6408
+ else
6409
+ r2 = _nt_i_CR
6410
+ if r2
6411
+ r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
6412
+ r0 = r2
6413
+ else
6414
+ if (match_len = has_terminal?(" ", false, index))
6415
+ r3 = true
6416
+ @index += match_len
6417
+ else
6418
+ terminal_parse_failure('" "')
6419
+ r3 = nil
6420
+ end
6421
+ if r3
6422
+ r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
6423
+ r0 = r3
6424
+ else
6425
+ @index = i0
6426
+ r0 = nil
6427
+ end
6428
+ end
6429
+ end
6430
+
6431
+ node_cache[:i_blank][start_index] = r0
6432
+
6433
+ r0
6434
+ end
6435
+
6436
+ def _nt_i_non_lf
6437
+ start_index = index
6438
+ if node_cache[:i_non_lf].has_key?(index)
6439
+ cached = node_cache[:i_non_lf][index]
6440
+ if cached
6441
+ node_cache[:i_non_lf][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
6442
+ @index = cached.interval.end
6443
+ end
6444
+ return cached
6445
+ end
6446
+
6447
+ i0 = index
6448
+ r1 = _nt_i_HT
6449
+ if r1
6450
+ r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
6451
+ r0 = r1
6452
+ else
6453
+ r2 = _nt_i_CR
6454
+ if r2
6455
+ r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
6456
+ r0 = r2
6457
+ else
6458
+ if has_terminal?(@regexps[gr = '\A[\\ -&]'] ||= Regexp.new(gr), :regexp, index)
6459
+ r3 = true
6460
+ @index += 1
6461
+ else
6462
+ terminal_parse_failure('[\\ -&]')
6463
+ r3 = nil
6464
+ end
6465
+ if r3
6466
+ r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
6467
+ r0 = r3
6468
+ else
6469
+ if (match_len = has_terminal?("\\'", false, index))
6470
+ r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
6471
+ @index += match_len
6472
+ else
6473
+ terminal_parse_failure('"\\\\\'"')
6474
+ r4 = nil
6475
+ end
6476
+ if r4
6477
+ r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
6478
+ r0 = r4
6479
+ else
6480
+ if has_terminal?(@regexps[gr = '\A[\\(-\\[]'] ||= Regexp.new(gr), :regexp, index)
6481
+ r5 = true
6482
+ @index += 1
6483
+ else
6484
+ terminal_parse_failure('[\\(-\\[]')
6485
+ r5 = nil
6486
+ end
6487
+ if r5
6488
+ r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
6489
+ r0 = r5
6490
+ else
6491
+ if (match_len = has_terminal?("\\\\", false, index))
6492
+ r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
6493
+ @index += match_len
6494
+ else
6495
+ terminal_parse_failure('"\\\\\\\\"')
6496
+ r6 = nil
6497
+ end
6498
+ if r6
6499
+ r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
6500
+ r0 = r6
6501
+ else
6502
+ if has_terminal?(@regexps[gr = '\A[\\]-]'] ||= Regexp.new(gr), :regexp, index)
6503
+ r7 = true
6504
+ @index += 1
6505
+ else
6506
+ terminal_parse_failure('[\\]-]')
6507
+ r7 = nil
6508
+ end
6509
+ if r7
6510
+ r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
6511
+ r0 = r7
6512
+ else
6513
+ r8 = _nt_i_NONASCII
6514
+ if r8
6515
+ r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
6516
+ r0 = r8
6517
+ else
6518
+ @index = i0
6519
+ r0 = nil
6520
+ end
6521
+ end
6522
+ end
6523
+ end
6524
+ end
6525
+ end
6526
+ end
6527
+ end
6528
+
6529
+ node_cache[:i_non_lf][start_index] = r0
6530
+
6531
+ r0
6532
+ end
6533
+
6324
6534
  module INONASCII0
6325
6535
  def ESCGE7F
6326
6536
  elements[1]
@@ -7404,7 +7614,7 @@ module EDNGRAMMAR
7404
7614
  if r14
7405
7615
  s15, i15 = [], index
7406
7616
  loop do
7407
- r16 = _nt_h_non_lf
7617
+ r16 = _nt_i_non_lf
7408
7618
  if r16
7409
7619
  s15 << r16
7410
7620
  else
@@ -7443,209 +7653,142 @@ module EDNGRAMMAR
7443
7653
  r0
7444
7654
  end
7445
7655
 
7446
- def _nt_h_blank
7447
- start_index = index
7448
- if node_cache[:h_blank].has_key?(index)
7449
- cached = node_cache[:h_blank][index]
7450
- if cached
7451
- node_cache[:h_blank][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7452
- @index = cached.interval.end
7453
- end
7454
- return cached
7455
- end
7456
-
7457
- i0 = index
7458
- r1 = _nt_i_HT
7459
- if r1
7460
- r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
7461
- r0 = r1
7462
- else
7463
- r2 = _nt_i_LF
7464
- if r2
7465
- r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
7466
- r0 = r2
7467
- else
7468
- r3 = _nt_i_CR
7469
- if r3
7470
- r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
7471
- r0 = r3
7472
- else
7473
- if (match_len = has_terminal?(" ", false, index))
7474
- r4 = true
7475
- @index += match_len
7476
- else
7477
- terminal_parse_failure('" "')
7478
- r4 = nil
7479
- end
7480
- if r4
7481
- r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
7482
- r0 = r4
7483
- else
7484
- @index = i0
7485
- r0 = nil
7486
- end
7487
- end
7488
- end
7656
+ module HS0
7657
+ def h_comment
7658
+ elements[0]
7489
7659
  end
7490
7660
 
7491
- node_cache[:h_blank][start_index] = r0
7661
+ end
7492
7662
 
7493
- r0
7663
+ module HS1
7494
7664
  end
7495
7665
 
7496
- def _nt_h_non_slash
7666
+ def _nt_h_S
7497
7667
  start_index = index
7498
- if node_cache[:h_non_slash].has_key?(index)
7499
- cached = node_cache[:h_non_slash][index]
7668
+ if node_cache[:h_S].has_key?(index)
7669
+ cached = node_cache[:h_S][index]
7500
7670
  if cached
7501
- node_cache[:h_non_slash][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7671
+ node_cache[:h_S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7502
7672
  @index = cached.interval.end
7503
7673
  end
7504
7674
  return cached
7505
7675
  end
7506
7676
 
7507
- i0 = index
7508
- r1 = _nt_h_blank
7509
- if r1
7510
- r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
7511
- r0 = r1
7512
- else
7513
- if has_terminal?(@regexps[gr = '\A[!-&]'] ||= Regexp.new(gr), :regexp, index)
7514
- r2 = true
7515
- @index += 1
7516
- else
7517
- terminal_parse_failure('[!-&]')
7518
- r2 = nil
7519
- end
7677
+ i0, s0 = index, []
7678
+ s1, i1 = [], index
7679
+ loop do
7680
+ r2 = _nt_i_blank
7520
7681
  if r2
7521
- r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
7522
- r0 = r2
7682
+ s1 << r2
7523
7683
  else
7524
- if (match_len = has_terminal?("\\'", false, index))
7525
- r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
7526
- @index += match_len
7527
- else
7528
- terminal_parse_failure('"\\\\\'"')
7529
- r3 = nil
7530
- end
7531
- if r3
7532
- r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
7533
- r0 = r3
7534
- else
7535
- if has_terminal?(@regexps[gr = '\A[\\(-\\.]'] ||= Regexp.new(gr), :regexp, index)
7536
- r4 = true
7537
- @index += 1
7538
- else
7539
- terminal_parse_failure('[\\(-\\.]')
7540
- r4 = nil
7541
- end
7542
- if r4
7543
- r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
7544
- r0 = r4
7545
- else
7546
- if has_terminal?(@regexps[gr = '\A[0-\\[]'] ||= Regexp.new(gr), :regexp, index)
7547
- r5 = true
7548
- @index += 1
7549
- else
7550
- terminal_parse_failure('[0-\\[]')
7551
- r5 = nil
7552
- end
7553
- if r5
7554
- r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
7555
- r0 = r5
7684
+ break
7685
+ end
7686
+ end
7687
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
7688
+ s0 << r1
7689
+ if r1
7690
+ s3, i3 = [], index
7691
+ loop do
7692
+ i4, s4 = index, []
7693
+ r5 = _nt_h_comment
7694
+ s4 << r5
7695
+ if r5
7696
+ s6, i6 = [], index
7697
+ loop do
7698
+ r7 = _nt_i_blank
7699
+ if r7
7700
+ s6 << r7
7556
7701
  else
7557
- if (match_len = has_terminal?("\\\\", false, index))
7558
- r6 = instantiate_node(SyntaxNode,input, index...(index + match_len))
7559
- @index += match_len
7560
- else
7561
- terminal_parse_failure('"\\\\\\\\"')
7562
- r6 = nil
7563
- end
7564
- if r6
7565
- r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
7566
- r0 = r6
7567
- else
7568
- if has_terminal?(@regexps[gr = '\A[\\]-]'] ||= Regexp.new(gr), :regexp, index)
7569
- r7 = true
7570
- @index += 1
7571
- else
7572
- terminal_parse_failure('[\\]-]')
7573
- r7 = nil
7574
- end
7575
- if r7
7576
- r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
7577
- r0 = r7
7578
- else
7579
- r8 = _nt_i_NONASCII
7580
- if r8
7581
- r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
7582
- r0 = r8
7583
- else
7584
- @index = i0
7585
- r0 = nil
7586
- end
7587
- end
7588
- end
7702
+ break
7589
7703
  end
7590
7704
  end
7705
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
7706
+ s4 << r6
7707
+ end
7708
+ if s4.last
7709
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
7710
+ r4.extend(HS0)
7711
+ else
7712
+ @index = i4
7713
+ r4 = nil
7714
+ end
7715
+ if r4
7716
+ s3 << r4
7717
+ else
7718
+ break
7591
7719
  end
7592
7720
  end
7721
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
7722
+ s0 << r3
7723
+ end
7724
+ if s0.last
7725
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
7726
+ r0.extend(HS1)
7727
+ else
7728
+ @index = i0
7729
+ r0 = nil
7593
7730
  end
7594
7731
 
7595
- node_cache[:h_non_slash][start_index] = r0
7732
+ node_cache[:h_S][start_index] = r0
7596
7733
 
7597
7734
  r0
7598
7735
  end
7599
7736
 
7600
- def _nt_h_non_lf
7737
+ def _nt_h_non_slash
7601
7738
  start_index = index
7602
- if node_cache[:h_non_lf].has_key?(index)
7603
- cached = node_cache[:h_non_lf][index]
7739
+ if node_cache[:h_non_slash].has_key?(index)
7740
+ cached = node_cache[:h_non_slash][index]
7604
7741
  if cached
7605
- node_cache[:h_non_lf][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7742
+ node_cache[:h_non_slash][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7606
7743
  @index = cached.interval.end
7607
7744
  end
7608
7745
  return cached
7609
7746
  end
7610
7747
 
7611
7748
  i0 = index
7612
- r1 = _nt_i_HT
7749
+ r1 = _nt_i_blank
7613
7750
  if r1
7614
7751
  r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
7615
7752
  r0 = r1
7616
7753
  else
7617
- r2 = _nt_i_CR
7754
+ if has_terminal?(@regexps[gr = '\A[!-&]'] ||= Regexp.new(gr), :regexp, index)
7755
+ r2 = true
7756
+ @index += 1
7757
+ else
7758
+ terminal_parse_failure('[!-&]')
7759
+ r2 = nil
7760
+ end
7618
7761
  if r2
7619
7762
  r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
7620
7763
  r0 = r2
7621
7764
  else
7622
- if has_terminal?(@regexps[gr = '\A[\\ -&]'] ||= Regexp.new(gr), :regexp, index)
7623
- r3 = true
7624
- @index += 1
7765
+ if (match_len = has_terminal?("\\'", false, index))
7766
+ r3 = instantiate_node(SyntaxNode,input, index...(index + match_len))
7767
+ @index += match_len
7625
7768
  else
7626
- terminal_parse_failure('[\\ -&]')
7769
+ terminal_parse_failure('"\\\\\'"')
7627
7770
  r3 = nil
7628
7771
  end
7629
7772
  if r3
7630
7773
  r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
7631
7774
  r0 = r3
7632
7775
  else
7633
- if (match_len = has_terminal?("\\'", false, index))
7634
- r4 = instantiate_node(SyntaxNode,input, index...(index + match_len))
7635
- @index += match_len
7776
+ if has_terminal?(@regexps[gr = '\A[\\(-\\.]'] ||= Regexp.new(gr), :regexp, index)
7777
+ r4 = true
7778
+ @index += 1
7636
7779
  else
7637
- terminal_parse_failure('"\\\\\'"')
7780
+ terminal_parse_failure('[\\(-\\.]')
7638
7781
  r4 = nil
7639
7782
  end
7640
7783
  if r4
7641
7784
  r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
7642
7785
  r0 = r4
7643
7786
  else
7644
- if has_terminal?(@regexps[gr = '\A[\\(-\\[]'] ||= Regexp.new(gr), :regexp, index)
7787
+ if has_terminal?(@regexps[gr = '\A[0-\\[]'] ||= Regexp.new(gr), :regexp, index)
7645
7788
  r5 = true
7646
7789
  @index += 1
7647
7790
  else
7648
- terminal_parse_failure('[\\(-\\[]')
7791
+ terminal_parse_failure('[0-\\[]')
7649
7792
  r5 = nil
7650
7793
  end
7651
7794
  if r5
@@ -7690,88 +7833,7 @@ module EDNGRAMMAR
7690
7833
  end
7691
7834
  end
7692
7835
 
7693
- node_cache[:h_non_lf][start_index] = r0
7694
-
7695
- r0
7696
- end
7697
-
7698
- module HS0
7699
- def h_comment
7700
- elements[0]
7701
- end
7702
-
7703
- end
7704
-
7705
- module HS1
7706
- end
7707
-
7708
- def _nt_h_S
7709
- start_index = index
7710
- if node_cache[:h_S].has_key?(index)
7711
- cached = node_cache[:h_S][index]
7712
- if cached
7713
- node_cache[:h_S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7714
- @index = cached.interval.end
7715
- end
7716
- return cached
7717
- end
7718
-
7719
- i0, s0 = index, []
7720
- s1, i1 = [], index
7721
- loop do
7722
- r2 = _nt_h_blank
7723
- if r2
7724
- s1 << r2
7725
- else
7726
- break
7727
- end
7728
- end
7729
- r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
7730
- s0 << r1
7731
- if r1
7732
- s3, i3 = [], index
7733
- loop do
7734
- i4, s4 = index, []
7735
- r5 = _nt_h_comment
7736
- s4 << r5
7737
- if r5
7738
- s6, i6 = [], index
7739
- loop do
7740
- r7 = _nt_h_blank
7741
- if r7
7742
- s6 << r7
7743
- else
7744
- break
7745
- end
7746
- end
7747
- r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
7748
- s4 << r6
7749
- end
7750
- if s4.last
7751
- r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
7752
- r4.extend(HS0)
7753
- else
7754
- @index = i4
7755
- r4 = nil
7756
- end
7757
- if r4
7758
- s3 << r4
7759
- else
7760
- break
7761
- end
7762
- end
7763
- r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
7764
- s0 << r3
7765
- end
7766
- if s0.last
7767
- r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
7768
- r0.extend(HS1)
7769
- else
7770
- @index = i0
7771
- r0 = nil
7772
- end
7773
-
7774
- node_cache[:h_S][start_index] = r0
7836
+ node_cache[:h_non_slash][start_index] = r0
7775
7837
 
7776
7838
  r0
7777
7839
  end
@@ -7852,7 +7914,7 @@ module EDNGRAMMAR
7852
7914
  if r7
7853
7915
  s8, i8 = [], index
7854
7916
  loop do
7855
- r9 = _nt_h_non_lf
7917
+ r9 = _nt_i_non_lf
7856
7918
  if r9
7857
7919
  s8 << r9
7858
7920
  else
@@ -7887,6 +7949,585 @@ module EDNGRAMMAR
7887
7949
  r0
7888
7950
  end
7889
7951
 
7952
+ module SqAppStringB640
7953
+ def app_string_b64
7954
+ elements[1]
7955
+ end
7956
+
7957
+ end
7958
+
7959
+ module SqAppStringB641
7960
+ def ast; app_string_b64.ast end
7961
+ end
7962
+
7963
+ def _nt_sq_app_string_b64
7964
+ start_index = index
7965
+ if node_cache[:sq_app_string_b64].has_key?(index)
7966
+ cached = node_cache[:sq_app_string_b64][index]
7967
+ if cached
7968
+ node_cache[:sq_app_string_b64][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
7969
+ @index = cached.interval.end
7970
+ end
7971
+ return cached
7972
+ end
7973
+
7974
+ i0, s0 = index, []
7975
+ if (match_len = has_terminal?("b64'", false, index))
7976
+ r1 = instantiate_node(SyntaxNode,input, index...(index + match_len))
7977
+ @index += match_len
7978
+ else
7979
+ terminal_parse_failure('"b64\'"')
7980
+ r1 = nil
7981
+ end
7982
+ s0 << r1
7983
+ if r1
7984
+ r2 = _nt_app_string_b64
7985
+ s0 << r2
7986
+ if r2
7987
+ if (match_len = has_terminal?("'", false, index))
7988
+ r3 = true
7989
+ @index += match_len
7990
+ else
7991
+ terminal_parse_failure('"\'"')
7992
+ r3 = nil
7993
+ end
7994
+ s0 << r3
7995
+ end
7996
+ end
7997
+ if s0.last
7998
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
7999
+ r0.extend(SqAppStringB640)
8000
+ r0.extend(SqAppStringB641)
8001
+ else
8002
+ @index = i0
8003
+ r0 = nil
8004
+ end
8005
+
8006
+ node_cache[:sq_app_string_b64][start_index] = r0
8007
+
8008
+ r0
8009
+ end
8010
+
8011
+ module AppStringB640
8012
+ def b64dig
8013
+ elements[0]
8014
+ end
8015
+
8016
+ def b64_S
8017
+ elements[1]
8018
+ end
8019
+ end
8020
+
8021
+ module AppStringB641
8022
+ def b64_S
8023
+ elements[1]
8024
+ end
8025
+
8026
+ end
8027
+
8028
+ module AppStringB642
8029
+ def b64dig
8030
+ elements[0]
8031
+ end
8032
+
8033
+ def b64_S
8034
+ elements[1]
8035
+ end
8036
+
8037
+ end
8038
+
8039
+ module AppStringB643
8040
+ def b64dig1
8041
+ elements[0]
8042
+ end
8043
+
8044
+ def b64_S1
8045
+ elements[1]
8046
+ end
8047
+
8048
+ def b64dig2
8049
+ elements[2]
8050
+ end
8051
+
8052
+ def b64_S2
8053
+ elements[3]
8054
+ end
8055
+
8056
+ def b64_S3
8057
+ elements[5]
8058
+ end
8059
+ end
8060
+
8061
+ module AppStringB644
8062
+ end
8063
+
8064
+ module AppStringB645
8065
+ def b64_S
8066
+ elements[0]
8067
+ end
8068
+
8069
+ end
8070
+
8071
+ module AppStringB646
8072
+ def ast
8073
+ t = text_value.gsub(/\s|#[^\n]*(?:\n|\z)/, '').chars.each_slice(4).map(&:join)
8074
+ if last = t[-1]
8075
+ last << "=" * (4 - last.size)
8076
+ end
8077
+ b = t.join.tr("-_", "+/")
8078
+ begin
8079
+ b.unpack("m0")[0]
8080
+ rescue ArgumentError
8081
+ raise ArgumentError, "cbor-diagnostic: invalid base64 #{b.inspect}", caller[1..-1]
8082
+ end
8083
+ end
8084
+ end
8085
+
8086
+ def _nt_app_string_b64
8087
+ start_index = index
8088
+ if node_cache[:app_string_b64].has_key?(index)
8089
+ cached = node_cache[:app_string_b64][index]
8090
+ if cached
8091
+ node_cache[:app_string_b64][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
8092
+ @index = cached.interval.end
8093
+ end
8094
+ return cached
8095
+ end
8096
+
8097
+ i0, s0 = index, []
8098
+ r1 = _nt_b64_S
8099
+ s0 << r1
8100
+ if r1
8101
+ s2, i2 = [], index
8102
+ loop do
8103
+ s3, i3 = [], index
8104
+ loop do
8105
+ i4, s4 = index, []
8106
+ r5 = _nt_b64dig
8107
+ s4 << r5
8108
+ if r5
8109
+ r6 = _nt_b64_S
8110
+ s4 << r6
8111
+ end
8112
+ if s4.last
8113
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
8114
+ r4.extend(AppStringB640)
8115
+ else
8116
+ @index = i4
8117
+ r4 = nil
8118
+ end
8119
+ if r4
8120
+ s3 << r4
8121
+ else
8122
+ break
8123
+ end
8124
+ if s3.size == 4
8125
+ break
8126
+ end
8127
+ end
8128
+ if s3.size < 4
8129
+ @index = i3
8130
+ r3 = nil
8131
+ else
8132
+ if s3.size < 4
8133
+ @terminal_failures.pop
8134
+ end
8135
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
8136
+ end
8137
+ if r3
8138
+ s2 << r3
8139
+ else
8140
+ break
8141
+ end
8142
+ end
8143
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
8144
+ s0 << r2
8145
+ if r2
8146
+ i8, s8 = index, []
8147
+ r9 = _nt_b64dig
8148
+ s8 << r9
8149
+ if r9
8150
+ r10 = _nt_b64_S
8151
+ s8 << r10
8152
+ if r10
8153
+ r11 = _nt_b64dig
8154
+ s8 << r11
8155
+ if r11
8156
+ r12 = _nt_b64_S
8157
+ s8 << r12
8158
+ if r12
8159
+ i14 = index
8160
+ i15, s15 = index, []
8161
+ if (match_len = has_terminal?("=", false, index))
8162
+ r16 = true
8163
+ @index += match_len
8164
+ else
8165
+ terminal_parse_failure('"="')
8166
+ r16 = nil
8167
+ end
8168
+ s15 << r16
8169
+ if r16
8170
+ r17 = _nt_b64_S
8171
+ s15 << r17
8172
+ if r17
8173
+ if (match_len = has_terminal?("=", false, index))
8174
+ r18 = true
8175
+ @index += match_len
8176
+ else
8177
+ terminal_parse_failure('"="')
8178
+ r18 = nil
8179
+ end
8180
+ s15 << r18
8181
+ end
8182
+ end
8183
+ if s15.last
8184
+ r15 = instantiate_node(SyntaxNode,input, i15...index, s15)
8185
+ r15.extend(AppStringB641)
8186
+ else
8187
+ @index = i15
8188
+ r15 = nil
8189
+ end
8190
+ if r15
8191
+ r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
8192
+ r14 = r15
8193
+ else
8194
+ i19, s19 = index, []
8195
+ r20 = _nt_b64dig
8196
+ s19 << r20
8197
+ if r20
8198
+ r21 = _nt_b64_S
8199
+ s19 << r21
8200
+ if r21
8201
+ if (match_len = has_terminal?("=", false, index))
8202
+ r23 = true
8203
+ @index += match_len
8204
+ else
8205
+ terminal_parse_failure('"="')
8206
+ r23 = nil
8207
+ end
8208
+ if r23
8209
+ r22 = r23
8210
+ else
8211
+ r22 = instantiate_node(SyntaxNode,input, index...index)
8212
+ end
8213
+ s19 << r22
8214
+ end
8215
+ end
8216
+ if s19.last
8217
+ r19 = instantiate_node(SyntaxNode,input, i19...index, s19)
8218
+ r19.extend(AppStringB642)
8219
+ else
8220
+ @index = i19
8221
+ r19 = nil
8222
+ end
8223
+ if r19
8224
+ r19 = SyntaxNode.new(input, (index-1)...index) if r19 == true
8225
+ r14 = r19
8226
+ else
8227
+ @index = i14
8228
+ r14 = nil
8229
+ end
8230
+ end
8231
+ if r14
8232
+ r13 = r14
8233
+ else
8234
+ r13 = instantiate_node(SyntaxNode,input, index...index)
8235
+ end
8236
+ s8 << r13
8237
+ if r13
8238
+ r24 = _nt_b64_S
8239
+ s8 << r24
8240
+ end
8241
+ end
8242
+ end
8243
+ end
8244
+ end
8245
+ if s8.last
8246
+ r8 = instantiate_node(SyntaxNode,input, i8...index, s8)
8247
+ r8.extend(AppStringB643)
8248
+ else
8249
+ @index = i8
8250
+ r8 = nil
8251
+ end
8252
+ if r8
8253
+ r7 = r8
8254
+ else
8255
+ r7 = instantiate_node(SyntaxNode,input, index...index)
8256
+ end
8257
+ s0 << r7
8258
+ if r7
8259
+ i26, s26 = index, []
8260
+ if (match_len = has_terminal?("#", false, index))
8261
+ r27 = true
8262
+ @index += match_len
8263
+ else
8264
+ terminal_parse_failure('"#"')
8265
+ r27 = nil
8266
+ end
8267
+ s26 << r27
8268
+ if r27
8269
+ s28, i28 = [], index
8270
+ loop do
8271
+ r29 = _nt_i_non_lf
8272
+ if r29
8273
+ s28 << r29
8274
+ else
8275
+ break
8276
+ end
8277
+ end
8278
+ r28 = instantiate_node(SyntaxNode,input, i28...index, s28)
8279
+ s26 << r28
8280
+ end
8281
+ if s26.last
8282
+ r26 = instantiate_node(SyntaxNode,input, i26...index, s26)
8283
+ r26.extend(AppStringB644)
8284
+ else
8285
+ @index = i26
8286
+ r26 = nil
8287
+ end
8288
+ if r26
8289
+ r25 = r26
8290
+ else
8291
+ r25 = instantiate_node(SyntaxNode,input, index...index)
8292
+ end
8293
+ s0 << r25
8294
+ end
8295
+ end
8296
+ end
8297
+ if s0.last
8298
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
8299
+ r0.extend(AppStringB645)
8300
+ r0.extend(AppStringB646)
8301
+ else
8302
+ @index = i0
8303
+ r0 = nil
8304
+ end
8305
+
8306
+ node_cache[:app_string_b64][start_index] = r0
8307
+
8308
+ r0
8309
+ end
8310
+
8311
+ def _nt_b64dig
8312
+ start_index = index
8313
+ if node_cache[:b64dig].has_key?(index)
8314
+ cached = node_cache[:b64dig][index]
8315
+ if cached
8316
+ node_cache[:b64dig][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
8317
+ @index = cached.interval.end
8318
+ end
8319
+ return cached
8320
+ end
8321
+
8322
+ i0 = index
8323
+ r1 = _nt_ALPHA
8324
+ if r1
8325
+ r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
8326
+ r0 = r1
8327
+ else
8328
+ r2 = _nt_DIGIT
8329
+ if r2
8330
+ r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
8331
+ r0 = r2
8332
+ else
8333
+ if (match_len = has_terminal?("-", false, index))
8334
+ r3 = true
8335
+ @index += match_len
8336
+ else
8337
+ terminal_parse_failure('"-"')
8338
+ r3 = nil
8339
+ end
8340
+ if r3
8341
+ r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
8342
+ r0 = r3
8343
+ else
8344
+ if (match_len = has_terminal?("_", false, index))
8345
+ r4 = true
8346
+ @index += match_len
8347
+ else
8348
+ terminal_parse_failure('"_"')
8349
+ r4 = nil
8350
+ end
8351
+ if r4
8352
+ r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
8353
+ r0 = r4
8354
+ else
8355
+ if (match_len = has_terminal?("+", false, index))
8356
+ r5 = true
8357
+ @index += match_len
8358
+ else
8359
+ terminal_parse_failure('"+"')
8360
+ r5 = nil
8361
+ end
8362
+ if r5
8363
+ r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
8364
+ r0 = r5
8365
+ else
8366
+ if (match_len = has_terminal?("/", false, index))
8367
+ r6 = true
8368
+ @index += match_len
8369
+ else
8370
+ terminal_parse_failure('"/"')
8371
+ r6 = nil
8372
+ end
8373
+ if r6
8374
+ r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
8375
+ r0 = r6
8376
+ else
8377
+ @index = i0
8378
+ r0 = nil
8379
+ end
8380
+ end
8381
+ end
8382
+ end
8383
+ end
8384
+ end
8385
+
8386
+ node_cache[:b64dig][start_index] = r0
8387
+
8388
+ r0
8389
+ end
8390
+
8391
+ module B64S0
8392
+ def b64_comment
8393
+ elements[0]
8394
+ end
8395
+
8396
+ end
8397
+
8398
+ module B64S1
8399
+ end
8400
+
8401
+ def _nt_b64_S
8402
+ start_index = index
8403
+ if node_cache[:b64_S].has_key?(index)
8404
+ cached = node_cache[:b64_S][index]
8405
+ if cached
8406
+ node_cache[:b64_S][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
8407
+ @index = cached.interval.end
8408
+ end
8409
+ return cached
8410
+ end
8411
+
8412
+ i0, s0 = index, []
8413
+ s1, i1 = [], index
8414
+ loop do
8415
+ r2 = _nt_i_blank
8416
+ if r2
8417
+ s1 << r2
8418
+ else
8419
+ break
8420
+ end
8421
+ end
8422
+ r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
8423
+ s0 << r1
8424
+ if r1
8425
+ s3, i3 = [], index
8426
+ loop do
8427
+ i4, s4 = index, []
8428
+ r5 = _nt_b64_comment
8429
+ s4 << r5
8430
+ if r5
8431
+ s6, i6 = [], index
8432
+ loop do
8433
+ r7 = _nt_i_blank
8434
+ if r7
8435
+ s6 << r7
8436
+ else
8437
+ break
8438
+ end
8439
+ end
8440
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
8441
+ s4 << r6
8442
+ end
8443
+ if s4.last
8444
+ r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
8445
+ r4.extend(B64S0)
8446
+ else
8447
+ @index = i4
8448
+ r4 = nil
8449
+ end
8450
+ if r4
8451
+ s3 << r4
8452
+ else
8453
+ break
8454
+ end
8455
+ end
8456
+ r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
8457
+ s0 << r3
8458
+ end
8459
+ if s0.last
8460
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
8461
+ r0.extend(B64S1)
8462
+ else
8463
+ @index = i0
8464
+ r0 = nil
8465
+ end
8466
+
8467
+ node_cache[:b64_S][start_index] = r0
8468
+
8469
+ r0
8470
+ end
8471
+
8472
+ module B64Comment0
8473
+ end
8474
+
8475
+ def _nt_b64_comment
8476
+ start_index = index
8477
+ if node_cache[:b64_comment].has_key?(index)
8478
+ cached = node_cache[:b64_comment][index]
8479
+ if cached
8480
+ node_cache[:b64_comment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
8481
+ @index = cached.interval.end
8482
+ end
8483
+ return cached
8484
+ end
8485
+
8486
+ i0, s0 = index, []
8487
+ if (match_len = has_terminal?("#", false, index))
8488
+ r1 = true
8489
+ @index += match_len
8490
+ else
8491
+ terminal_parse_failure('"#"')
8492
+ r1 = nil
8493
+ end
8494
+ s0 << r1
8495
+ if r1
8496
+ s2, i2 = [], index
8497
+ loop do
8498
+ r3 = _nt_i_non_lf
8499
+ if r3
8500
+ s2 << r3
8501
+ else
8502
+ break
8503
+ end
8504
+ end
8505
+ r2 = instantiate_node(SyntaxNode,input, i2...index, s2)
8506
+ s0 << r2
8507
+ if r2
8508
+ if (match_len = has_terminal?("\n", false, index))
8509
+ r4 = true
8510
+ @index += match_len
8511
+ else
8512
+ terminal_parse_failure('"\\n"')
8513
+ r4 = nil
8514
+ end
8515
+ s0 << r4
8516
+ end
8517
+ end
8518
+ if s0.last
8519
+ r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
8520
+ r0.extend(B64Comment0)
8521
+ else
8522
+ @index = i0
8523
+ r0 = nil
8524
+ end
8525
+
8526
+ node_cache[:b64_comment][start_index] = r0
8527
+
8528
+ r0
8529
+ end
8530
+
7890
8531
 
7891
8532
  class Parser < Treetop::Runtime::CompiledParser
7892
8533
  include EDNGRAMMAR
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edn-abnf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-28 00:00:00.000000000 Z
10
+ date: 2025-04-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler