work
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 17 Oct 2025 21:36:51 +0000 (14:36 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 17 Oct 2025 21:36:51 +0000 (14:36 -0700)
rust/doc/src/spv/legacy-detail-xml.md
rust/pspp/src/output/pivot.rs
rust/pspp/src/output/spv/legacy.rs

index f7e77f0c322e9b5ad07b216cb28d2dae9d9052fa..cdbcc4af1c6cfb09b7bdeb4be37e87e79ed98949 100644 (file)
@@ -671,7 +671,7 @@ text
    :usesReference=int?
    :definesReference=int?
    :position=(subscript | superscript)?
-   :style=ref style
+   :style=ref style?
 => TEXT
 ```
 
index 4dce028d29e5b658976e4bd1693ca2b3cd67bbd4..b68d936e340500f175f3698f54dfc55eef7bf0ba 100644 (file)
@@ -1240,7 +1240,7 @@ impl<'de> Deserialize<'de> for Color {
                 formatter.write_str("\"#rrggbb\" or \"rrggbb\" or web color name")
             }
 
-            fn visit_borrowed_str<E>(self, v: &'de str) -> Result<Self::Value, E>
+            fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
             where
                 E: serde::de::Error,
             {
@@ -3107,6 +3107,7 @@ mod test {
         assert_eq!(Color::from_str("rgb(12,34,56)"), Ok(Color::new(12, 34, 56)));
         assert_eq!(Color::from_str("#abcdef"), Ok(Color::new(0xab, 0xcd, 0xef)));
         assert_eq!(Color::from_str("abcdef"), Ok(Color::new(0xab, 0xcd, 0xef)));
+        assert_eq!(Color::from_str("transparent"), Ok(Color::TRANSPARENT));
     }
 
     #[test]
index 209f553e59cfa2332c146d0974e937bc6ebed2d8..7763db5cbdef8519c2fd4823c1754686e8706566 100644 (file)
@@ -56,12 +56,14 @@ pub struct Visualization {
 
     extension: Option<VisualizationExtension>,
     user_source: UserSource,
-    variables: Vec<Variable>,
+    /*#[serde(rename = "$value")]
+    variables: Vec<Variable>,*/
     categorical_domain: Option<CategoricalDomain>,
     graph: Graph,
-    lf1: LabelFrame,
+    #[serde(default, rename = "labelFrame")]
+    label_frames: Vec<LabelFrame>,
     container: Option<Container>,
-    lf2: LabelFrame,
+    #[serde(rename = "style")]
     styles: Vec<Style>,
     layer_controller: Option<LayerController>,
 }
@@ -97,6 +99,7 @@ struct SourceVariable {
     #[serde(rename = "@labelVariable")]
     label_variable: Option<Ref<SourceVariable>>,
 
+    #[serde(default, rename = "extension")]
     extensions: Vec<VariableExtension>,
     format: Option<Format>,
     string_format: Option<StringFormat>,
@@ -113,6 +116,7 @@ struct DerivedVariable {
     value: String,
     format: Option<Format>,
     string_format: Option<StringFormat>,
+    #[serde(default, rename = "valueMapEntry")]
     value_map: Vec<ValueMapEntry>,
 }
 
@@ -456,7 +460,7 @@ struct Relabel {
     #[serde(rename = "@from")]
     from: f64,
     #[serde(rename = "@to")]
-    to: f64,
+    to: String,
 }
 
 #[derive(Deserialize, Debug)]
@@ -612,6 +616,7 @@ struct Graph {
     #[serde(rename = "@style")]
     style: Ref<Style>,
 
+    #[serde(rename = "location")]
     locations: Vec<Location>,
     coordinates: Coordinates,
     faceting: Faceting,
@@ -655,7 +660,7 @@ struct Location {
 #[serde(rename_all = "camelCase")]
 enum Part {
     Height,
-    Wdith,
+    Width,
     Top,
     Bottom,
     Left,
@@ -685,7 +690,7 @@ struct Faceting {
 #[serde(rename_all = "camelCase")]
 struct Cross {
     #[serde(rename = "$value")]
-    child: CrossChild,
+    children: Vec<CrossChild>,
 }
 
 #[derive(Deserialize, Debug)]
@@ -694,10 +699,10 @@ enum CrossChild {
     /// No dimensions along this axis.
     Unity,
     /// Dimensions along this axis.
-    Nest(
-        /// From innermost to outermost.
-        Vec<VariableReference>,
-    ),
+    Nest, /*(
+              /// From innermost to outermost.
+              Vec<VariableReference>,
+          )*/
 }
 
 #[derive(Deserialize, Debug)]
@@ -761,7 +766,14 @@ struct Union {
 
 #[derive(Deserialize, Debug)]
 #[serde(rename_all = "camelCase")]
-enum Intersect {
+struct Intersect {
+    #[serde(rename = "$value")]
+    child: Vec<IntersectChild>,
+}
+
+#[derive(Deserialize, Debug)]
+#[serde(rename_all = "camelCase")]
+enum IntersectChild {
     Where(Where),
     IntersectWhere(IntersectWhere),
     Alternating,
@@ -866,11 +878,12 @@ struct Interval {
 #[serde(rename_all = "camelCase")]
 struct Labeling {
     #[serde(rename = "@style")]
-    style: Ref<Style>,
+    style: Option<Ref<Style>>,
 
     #[serde(rename = "@variable")]
     variable: String,
 
+    #[serde(default)]
     children: Vec<LabelingChild>,
 }
 
@@ -987,11 +1000,12 @@ struct Label {
     style: Ref<Style>,
 
     #[serde(rename = "@textFrameStyle")]
-    text_frame_style: Ref<Style>,
+    text_frame_style: Option<Ref<Style>>,
 
     #[serde(rename = "@purpose")]
     purpose: Option<Purpose>,
 
+    #[serde(rename = "$value")]
     child: LabelChild,
 }
 
@@ -1025,7 +1039,7 @@ struct Text {
     position: Option<Position>,
 
     #[serde(rename = "@style")]
-    style: Ref<Style>,
+    style: Option<Ref<Style>>,
 
     #[serde(default, rename = "$text")]
     text: String,
@@ -1069,6 +1083,7 @@ enum Name {
 struct LabelFrame {
     #[serde(rename = "@style")]
     style: Ref<Style>,
+    #[serde(rename = "location")]
     locations: Vec<Location>,
     label: Option<Label>,
     paragraph: Option<Paragraph>,
@@ -1084,6 +1099,7 @@ struct Container {
     #[serde(rename = "@style")]
     style: Ref<Style>,
 
+    #[serde(default, rename = "extension")]
     extensions: Option<ContainerExtension>,
     locations: Vec<Location>,
     label_frames: Vec<LabelFrame>,