mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(parser): parse jsx element and fragment in JSXAttributeValue
This commit is contained in:
parent
1130f48278
commit
adedc1a405
2 changed files with 9 additions and 9 deletions
|
|
@ -336,6 +336,13 @@ impl<'a> Parser<'a> {
|
|||
let expr = self.parse_jsx_expression_container(false)?;
|
||||
Ok(JSXAttributeValue::ExpressionContainer(expr))
|
||||
}
|
||||
Kind::LAngle => {
|
||||
if self.peek_at(Kind::RAngle) {
|
||||
self.parse_jsx_fragment().map(JSXAttributeValue::Fragment)
|
||||
} else {
|
||||
self.parse_jsx_element(false).map(JSXAttributeValue::Element)
|
||||
}
|
||||
}
|
||||
_ => Err(self.unexpected()),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
TypeScript Summary:
|
||||
AST Parsed : 2336/2340 (99.83%)
|
||||
Positive Passed: 2330/2340 (99.57%)
|
||||
Negative Passed: 673/2532 (26.58%)
|
||||
Negative Passed: 672/2532 (26.54%)
|
||||
Expect Syntax Error: "Symbols/ES5SymbolProperty2.ts"
|
||||
Expect Syntax Error: "Symbols/ES5SymbolProperty6.ts"
|
||||
Expect Syntax Error: "additionalChecks/noPropertyAccessFromIndexSignature1.ts"
|
||||
|
|
@ -1010,6 +1010,7 @@ Expect Syntax Error: "jsx/checkJsxChildrenProperty4.tsx"
|
|||
Expect Syntax Error: "jsx/checkJsxChildrenProperty5.tsx"
|
||||
Expect Syntax Error: "jsx/checkJsxChildrenProperty7.tsx"
|
||||
Expect Syntax Error: "jsx/checkJsxGenericTagHasCorrectInferences.tsx"
|
||||
Expect Syntax Error: "jsx/jsxEsprimaFbTestSuite.tsx"
|
||||
Expect Syntax Error: "jsx/jsxSpreadOverwritesAttributeStrict.tsx"
|
||||
Expect Syntax Error: "jsx/tsxAttributeErrors.tsx"
|
||||
Expect Syntax Error: "jsx/tsxAttributeResolution1.tsx"
|
||||
|
|
@ -8155,14 +8156,6 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
|||
9 │
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[jsx/jsxEsprimaFbTestSuite.tsx:40:1]
|
||||
40 │
|
||||
41 │ <LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;
|
||||
· ─
|
||||
42 │
|
||||
╰────
|
||||
|
||||
× TS18007: JSX expressions may not use the comma operator.
|
||||
╭─[jsx/jsxParsingError1.tsx:13:1]
|
||||
13 │ const class2 = "bar";
|
||||
|
|
|
|||
Loading…
Reference in a new issue