dmc-parser 0.2.3

Typed AST parser for the dmc MDX compiler
Documentation
use duck_diagnostic::Span;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct JsxAttr {
  pub name: String,
  pub value: JsxAttrValue,
  pub span: Span,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum JsxAttrValue {
  String(String),
  Expression(String),
  Boolean,
  /// `{...rest}` spread attribute. The string is the raw expression
  /// body (without the surrounding `{...}`). `JsxAttr.name` is empty
  /// for spread attributes.
  Spread(String),
}