edn-abnf 0.3.3 → 0.3.4

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: a7e57901f15e144386956e94dd3aaa6b808786e4d41b7ff5b5c1c5bc54c0df35
4
- data.tar.gz: 35f7b7e937487e76f4f5f21ee265346099274eb62e87675912c28a49b57a68b1
3
+ metadata.gz: be3442eabfe91c73cff8572576b27a53fb84ac50e55e3063c883de6016b11a1a
4
+ data.tar.gz: 163f0500284e03ec64631fe608c2664b6450056b954d8d9a59b8531dad30274a
5
5
  SHA512:
6
- metadata.gz: aeba40ba7ed1e0c9e19da2b10e236fce5d15b1cead0c128050c9b40b0500787a0377126d83f413582bdc04199534b58830dd105ed3bb4944c57d8ba90ce808e3
7
- data.tar.gz: c5cca7b60d9059f98956d1aa18eae7a039d5de44e623e296d59019d27ded411063eb9dc584f6e82391d7b0d1b20206e789dd62694e95c4827b3179138742a99c
6
+ metadata.gz: 514a619e123731703f5a8e126583c5d6ba6d501b25932dd049379f3328aba79f07be153df04a0a8aec7fd82f694dc60b57fb4d0d41e4f888a442ac74bbb2f563
7
+ data.tar.gz: 0cf73998452ca7f667003079252bd85c2a3f549eb33ec4a1b4a259be63b92e9cce9da01c738994cf99d0968d71845d737ef530abb2d157243106b72133050092
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.3"
3
+ s.version = "0.3.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"
@@ -13,10 +13,10 @@ class CBOR_DIAG::App_dt
13
13
  if !ast
14
14
  raise ArgumentError, "cbor-diagnostic: Parse Error in dt'#{s}':\n" << EDN.reason(parser, s)
15
15
  end
16
- # ast.ast
16
+ frac = ast.has_frac != ""
17
17
 
18
18
  t = Time.iso8601(s)
19
- tv = if t.subsec != 0
19
+ tv = if frac # t.subsec != 0
20
20
  t.to_f
21
21
  else
22
22
  t.to_i
@@ -443,6 +443,10 @@ module DTGRAMMAR
443
443
 
444
444
  end
445
445
 
446
+ module PartialTime1
447
+ def has_frac; elements[5].text_value end
448
+ end
449
+
446
450
  def _nt_partial_time
447
451
  start_index = index
448
452
  if node_cache[:partial_time].has_key?(index)
@@ -497,6 +501,7 @@ module DTGRAMMAR
497
501
  if s0.last
498
502
  r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
499
503
  r0.extend(PartialTime0)
504
+ r0.extend(PartialTime1)
500
505
  else
501
506
  @index = i0
502
507
  r0 = nil
@@ -586,6 +591,10 @@ module DTGRAMMAR
586
591
  end
587
592
  end
588
593
 
594
+ module FullTime1
595
+ def has_frac; partial_time.has_frac end
596
+ end
597
+
589
598
  def _nt_full_time
590
599
  start_index = index
591
600
  if node_cache[:full_time].has_key?(index)
@@ -607,6 +616,7 @@ module DTGRAMMAR
607
616
  if s0.last
608
617
  r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
609
618
  r0.extend(FullTime0)
619
+ r0.extend(FullTime1)
610
620
  else
611
621
  @index = i0
612
622
  r0 = nil
@@ -627,6 +637,10 @@ module DTGRAMMAR
627
637
  end
628
638
  end
629
639
 
640
+ module DateTime1
641
+ def has_frac; full_time.has_frac end
642
+ end
643
+
630
644
  def _nt_date_time
631
645
  start_index = index
632
646
  if node_cache[:date_time].has_key?(index)
@@ -658,6 +672,7 @@ module DTGRAMMAR
658
672
  if s0.last
659
673
  r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
660
674
  r0.extend(DateTime0)
675
+ r0.extend(DateTime1)
661
676
  else
662
677
  @index = i0
663
678
  r0 = nil
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.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-28 00:00:00.000000000 Z
11
+ date: 2025-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler