Open elizabethdinella opened 5 years ago
No, we track the ECMAScript spec.
That said, it probably would not be too hard to extend the parser yourself to do so. Something along the lines of
let { GenericParser } = require('shift-parser'); // or ParserWithLocation if you want the location side-table
class JSXParser extends GenericParser {
parsePrimaryExpression() {
if (this.match(TokenType.LT)) {
return this.parseJSX();
}
return super.parsePrimaryExpression();
}
parseJSX() {
// implementation goes here
}
}
let ast = (new JSXParser(code)).parseModule();
You might need to override the tokenizer methods as well; I don't know JSX well enough to know.
Are there any plans to add support for JSX?