pubid 2.0.0.pre.alpha.36 → 2.0.0.pre.alpha.37

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.
@@ -1137,13 +1137,18 @@ module Pubid
1137
1137
  # P15026.2/D=FDIS-201008") captures the stage and the verbatim
1138
1138
  # date token (":2020", "-201008") with no publisher slot; the
1139
1139
  # designator is the IEEE face, so IEEE is the sole publisher.
1140
- if parsed[:iso_stage] && parsed[:draft_stage_year]
1140
+ # The no-year form ("IEEE P12207/D=CD1") rides the same D=
1141
+ # designator when the stage carries the glued iteration digit —
1142
+ # the token boundary only the designation route produces.
1143
+ if parsed[:iso_stage] && (parsed[:draft_stage_year] ||
1144
+ (original_input.to_s.include?("/D=") &&
1145
+ extract_value(parsed[:iso_stage]).to_s.match?(/\A[A-Z]+\d\z/)))
1141
1146
  stage_word = extract_value(parsed[:iso_stage])
1142
1147
  attributes[:publishers] ||= ["IEEE"]
1143
1148
  attributes[:publisher] ||= "IEEE"
1144
1149
  attributes[:copublisher] ||= []
1145
1150
  attributes[:ieee_draft] =
1146
- "D=#{stage_word}#{extract_value(parsed[:draft_stage_year])}"
1151
+ "D=#{stage_word}#{extract_value(parsed[:draft_stage_year]).to_s}"
1147
1152
  attributes[:typed_stage] = Pubid::Ieee.locate_stage(stage_word)
1148
1153
  attributes[:lead_party] = "IEEE"
1149
1154
  attributes.delete(:year)
@@ -664,10 +664,12 @@ module Pubid
664
664
  str("ISO/IEC") | str("IEEE"))
665
665
  # ISO stage codes: FDIS, FCD, CDV; DIS/CD with an optional round
666
666
  # digit (DIS2, CD1..CD4); WD/PWI/NP.
667
- iso_stage = (str("FDIS") | str("FCD") | str("CDV") |
667
+ iso_stage = ((str("FDIS") >> digit.maybe) | (str("FCD") >> digit.maybe) |
668
+ (str("CDV") >> digit.maybe) |
668
669
  (str("DIS") >> digit.maybe) |
669
670
  (str("CD") >> digit.maybe) |
670
- str("WD") | str("PWI") | str("NP")).as(:iso_stage)
671
+ (str("WD") >> digit.maybe) | (str("PWI") >> digit.maybe) |
672
+ (str("NP") >> digit.maybe)).as(:iso_stage)
671
673
  std_noise = (space >> str("Std")).maybe
672
674
  # The empty-string marker distinguishes the stage-less PUBLISHED
673
675
  # tree in the builder (absence of :iso_stage alone means IEEE format).
@@ -719,10 +721,12 @@ module Pubid
719
721
  # D (draft) = the ISO/IEC stage it drafts, with its iteration
720
722
  # (docs/IEEE-DRAFT-STAGES.md §1.2).
721
723
  ((slash >> str("D") >> str("=") >>
722
- (str("FDIS") | str("FCD") | str("CDV") |
724
+ ((str("FDIS") >> digit.maybe) | (str("FCD") >> digit.maybe) |
725
+ (str("CDV") >> digit.maybe) |
723
726
  (str("DIS") >> digit.maybe) |
724
727
  (str("CD") >> digit.maybe) |
725
- str("WD") | str("PWI") | str("NP")).as(:draft_iso_stage) >>
728
+ (str("WD") >> digit.maybe) | (str("PWI") >> digit.maybe) |
729
+ (str("NP") >> digit.maybe)).as(:draft_iso_stage) >>
726
730
  (dot >> (digits >> match("[A-Za-z]").repeat(0, 1)).as(:draft_iso_iteration)).maybe) |
727
731
  (slash >> str("D") >> dash.maybe >>
728
732
  match('[0-9.]').repeat(1).as(:draft_version) >>
@@ -806,10 +810,12 @@ module Pubid
806
810
  # can't match inside a longer token and a glued no-space date
807
811
  # (".DISMay2013") is left to fall through.
808
812
  dot >>
809
- (str("FDIS") | str("FCD") | str("CDV") |
813
+ ((str("FDIS") >> digit.maybe) | (str("FCD") >> digit.maybe) |
814
+ (str("CDV") >> digit.maybe) |
810
815
  (str("DIS") >> digit.maybe) |
811
816
  (str("CD") >> digit.maybe) |
812
- str("WD") | str("PWI") | str("NP")).as(:iso_stage) >>
817
+ (str("WD") >> digit.maybe) | (str("PWI") >> digit.maybe) |
818
+ (str("NP") >> digit.maybe)).as(:iso_stage) >>
813
819
  (digit | match("[A-Za-z]")).absent? >>
814
820
  # optional trailing date: :YYYY, -YYYY[-MM], or text "Month YYYY"
815
821
  (
data/lib/pubid/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.0.pre.alpha.36"
4
+ VERSION = "2.0.0.pre.alpha.37"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha.36
4
+ version: 2.0.0.pre.alpha.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.