* First draft Everything works, the error messages for unmatched opening elements could still use improvement, plus there is tonnes of unused and ugly code. 1. Make sure the parser can recover from all kinds of unclosed tags. 2. Improve the parse tree for unmatched opening tags. 3. Better errors at some point. * Lots of cleanup * Improve readability of construction/fix lint * improve line-length formatting
49 lines
886 B
TypeScript
49 lines
886 B
TypeScript
//// [jsxAndTypeAssertion.tsx]
|
|
declare var createElement: any;
|
|
|
|
class foo {}
|
|
|
|
var x: any;
|
|
x = <any> { test: <any></any> };
|
|
|
|
x = <any><any></any>;
|
|
|
|
x = <foo>hello {<foo>{}} </foo>;
|
|
|
|
x = <foo test={<foo>{}}>hello</foo>;
|
|
|
|
x = <foo test={<foo>{}}>hello{<foo>{}}</foo>;
|
|
|
|
x = <foo>x</foo>, x = <foo/>;
|
|
|
|
<foo>{<foo><foo>{/foo/.test(x) ? <foo><foo></foo> : <foo><foo></foo>}</foo>}</foo>
|
|
|
|
|
|
|
|
|
|
//// [jsxAndTypeAssertion.jsx]
|
|
var foo = /** @class */ (function () {
|
|
function foo() {
|
|
}
|
|
return foo;
|
|
}());
|
|
var x;
|
|
x = <any> {test}: <any></any> };
|
|
|
|
x = <any><any></any>;
|
|
|
|
x = <foo>hello {<foo>} </foo>};
|
|
|
|
x = <foo test={<foo>}>hello</foo>}/>;
|
|
|
|
x = <foo test={<foo>}>hello{<foo>}</foo>};
|
|
|
|
x = <foo>x</foo>, x = <foo />;
|
|
|
|
<foo>{<foo><foo>{/foo/.test(x) ? <foo><foo></foo> : <foo><foo></foo>}</foo>}</foo>
|
|
:
|
|
}
|
|
|
|
|
|
</></>}</></>}/></></></>;
|