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/mdx_expression_text.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/mdx_expression_text.rs') diff --git a/tests/mdx_expression_text.rs b/tests/mdx_expression_text.rs index d893a70..0aee081 100644 --- a/tests/mdx_expression_text.rs +++ b/tests/mdx_expression_text.rs @@ -119,7 +119,7 @@ fn mdx_expression_text_gnostic_core() -> Result<(), String> { assert_eq!( micromark_with_options("a {var b = \"c\"} d", &swc).err().unwrap(), - "1:7: Could not parse expression with swc: Unexpected token `var`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier", + "1:4: Could not parse expression with swc: Unexpected token `var`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier", "should crash on non-expressions" ); @@ -213,7 +213,8 @@ fn mdx_expression_text_agnostic() -> Result<(), String> { }), Node::MdxTextExpression(MdxTextExpression { value: "alpha".to_string(), - position: Some(Position::new(1, 3, 2, 1, 10, 9)) + position: Some(Position::new(1, 3, 2, 1, 10, 9)), + stops: vec![(0, 3)] }), Node::Text(Text { value: " b.".to_string(), -- cgit