Skip to main content

dmc_parser/ast/
jsx.rs

1use duck_diagnostic::Span;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
5pub struct JsxAttr {
6  pub name: String,
7  pub value: JsxAttrValue,
8  pub span: Span,
9}
10
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub enum JsxAttrValue {
13  String(String),
14  Expression(String),
15  Boolean,
16  /// `{...rest}` spread attribute. The string is the raw expression
17  /// body (without the surrounding `{...}`). `JsxAttr.name` is empty
18  /// for spread attributes.
19  Spread(String),
20}