pub type ParseError = SyntaxError;Expand description
Parser errors share the syntax error type.
Aliased Type§
pub struct ParseError {
pub message: String,
pub span: Span,
pub positionless: bool,
}Fields§
§message: StringHuman readable message (no position prefix).
span: SpanWhere the error happened.
positionless: boolWhether the reference reports this error without a position.
Almost every syntax error is printed as SyntaxError: <message> followed by
at <file>:<line>:<column>. A handful are not, and the difference is not
cosmetic: the reference raises them from js_resolve_module, after parsing has
succeeded, so there is no position to give —
export {a} with no a prints a bare SyntaxError: exported variable 'a' does not exist. Our parser makes that check itself (it has the declared names in
hand), so it has to say “report me like a link error” explicitly.