copybook-dialect 0.4.3

Dialect contract for ODO min_count semantics
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented2 out of 2 items with examples
  • Size
  • Source code size: 52.81 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 398.97 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • EffortlessMetrics/copybook-rs
    0 0 4
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • EffortlessSteven

copybook-dialect

Shared dialect contract for ODO (OCCURS DEPENDING ON) min_count semantics.

Overview

Different COBOL compilers interpret the minimum occurrence count in ODO declarations differently. This crate provides the Dialect enum and an effective_min_count helper that normalizes declared bounds according to the selected dialect (IBM, Micro Focus, etc.).

Usage

use copybook_dialect::{Dialect, effective_min_count};
use std::str::FromStr;

let dialect = Dialect::from_str("1")?; // OneTolerant (Micro Focus)
assert_eq!(effective_min_count(dialect, 0), 1);
# Ok::<(), String>(())

Public API

  • DialectNormative, ZeroTolerant, OneTolerant
  • effective_min_count(dialect, declared_min_count) — Apply dialect rules

License

AGPL-3.0-or-later