1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::RantValue;

#[derive(Debug, Clone)]
pub struct OutputFormat {
  pub ws_norm_mode: WhitespaceNormalizationMode,
}

impl Default for OutputFormat {
  fn default() -> Self {
    Self {
      ws_norm_mode: Default::default(),
    }
  }
}

#[derive(Debug, Clone)]
pub enum WhitespaceNormalizationMode {
  /// Normalizes all whitespace tokens to a single ASCII space character (0x20).

  Default,
  /// Strips all (non-literal) whitespace.

  IgnoreAll,
  /// Prints all non-breaking whitespace verbatim.

  Verbatim,
  /// Normalizes all whitespace to a custom value.

  Custom(RantValue)
}

impl Default for WhitespaceNormalizationMode {
  fn default() -> Self {
    Self::Default
  }
}