From a4b56e7b971fa81c56a59b465f90c8016f01320d Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Tue, 11 Oct 2022 09:54:56 +0200 Subject: Add support for proper positional info in swc tree * Fix some positional info in SWC error messages * Add positional info in `to_document` on duplicate layouts * Add support for `path` on `Program` (`to_swc`, `to_document`, `jsx_rewrite`), for the path of a file on disk * Add support for `development` to `jsx-rewrite`, which when defined will embed info on where tags were written into the runtime code when they are not passed * Refactor to move some utilities to `micromark_swc_utils.rs`, `swc_utils.rs` --- tests/xxx_hast.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tests/xxx_hast.rs') diff --git a/tests/xxx_hast.rs b/tests/xxx_hast.rs index 886bcee..b0856a2 100644 --- a/tests/xxx_hast.rs +++ b/tests/xxx_hast.rs @@ -1137,10 +1137,12 @@ fn hast() { to_hast(&mdast::Node::MdxFlowExpression(mdast::MdxFlowExpression { value: "a".into(), position: None, + stops: vec![] })), hast::Node::MdxExpression(hast::MdxExpression { value: "a".into(), - position: None + position: None, + stops: vec![] }), "should support an `MdxFlowExpression`", ); @@ -1149,10 +1151,12 @@ fn hast() { to_hast(&mdast::Node::MdxTextExpression(mdast::MdxTextExpression { value: "a".into(), position: None, + stops: vec![] })), hast::Node::MdxExpression(hast::MdxExpression { value: "a".into(), - position: None + position: None, + stops: vec![] }), "should support an `MdxTextExpression`", ); @@ -1193,10 +1197,12 @@ fn hast() { to_hast(&mdast::Node::MdxjsEsm(mdast::MdxjsEsm { value: "a".into(), position: None, + stops: vec![] })), hast::Node::MdxjsEsm(hast::MdxjsEsm { value: "a".into(), - position: None + position: None, + stops: vec![] }), "should support an `MdxjsEsm`", ); -- cgit