From 3ac6d717e3f4f11a16b91013f8c43531a95f641d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 25 Feb 2022 20:04:28 +0100 Subject: [PATCH 1/2] Disallow `<` after a JSX element --- spec.emu | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/spec.emu b/spec.emu index 1692fb8..4e85184 100644 --- a/spec.emu +++ b/spec.emu @@ -52,10 +52,30 @@ render(dropdown);

Syntax

- PrimaryExpression : - JSXElement - JSXFragment + PrimaryExpression :: + JSXElementOrFragment `<` + JSXElementOrFragment + + +

Static Semantics: Early Errors

+ + PrimaryExpression :: JSXElementOrFragment `<` + + + + This Early Error prevents users from accidentally writing two adjacent JSX elements without wrapping them in a fragment: +

+// Invalid
+var elts = <a></a><b></b>
+
+// Valid
+var elts = <><a></a><b></b></>
+  
+
+
@@ -63,6 +83,10 @@ render(dropdown);

Syntax

+ JSXElementOrFragment :: + JSXElement + JSXFragment + JSXElement : JSXSelfClosingElement JSXOpeningElement JSXChildren? JSXClosingElement From 58edf8d8401b45ce50c4a7f9de7a2cf609f059e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 5 Mar 2022 12:14:02 +0100 Subject: [PATCH 2/2] Update spec.emu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Xuan Huang (黄玄) --- spec.emu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.emu b/spec.emu index 4e85184..2b31aae 100644 --- a/spec.emu +++ b/spec.emu @@ -52,7 +52,7 @@ render(dropdown);

Syntax

- PrimaryExpression :: + PrimaryExpression : JSXElementOrFragment `<` JSXElementOrFragment