Handling invalid syntax
Allow missing fields
Use bogus node
A custom node for invalid syntax
Example of AST ( function}
)
` `
JsBogusStatement {
items: [
[email protected] "}" [] [],
],
},
items: JsModuleItemList [
JsFunctionDeclaration {
async_token: missing (optional),
function_token:
[email protected] "function"
star_token: missing (optional),
id: missing (required),
type_parameters: missing (optional),
parameters: missing (required),
return_type_annotation: missing (optional),
body: missing (required),
},
],