(span: SpanId)
| 132 | "##; |
| 133 | |
| 134 | pub(crate) fn empty(span: SpanId) -> ArrayDiagnostic { |
| 135 | let mut diagnostic = Diagnostic::new(ArrayDiagnosticCategory::Empty, Critical::ERROR) |
| 136 | .primary(Label::new(span, "Empty array not allowed")); |
| 137 | |
| 138 | diagnostic.add_message(Message::help(EMPTY_HELP)); |
| 139 | diagnostic.add_message(Message::note(EMPTY_NOTE)); |
| 140 | |
| 141 | diagnostic |
| 142 | } |
| 143 | |
| 144 | const TRAILING_COMMA_HELP: &str = "J-Expr does not support trailing commas in arrays. Use \ |
| 145 | `[item1, item2]` instead of `[item1, item2,]`"; |