Report an error message. This may additionally sanity check the supplied context. @param e @param code @param context
(Syntactic.Item e, int code, Syntactic.Item... context)
| 505 | * @param context |
| 506 | */ |
| 507 | public static void syntaxError(Syntactic.Item e, int code, Syntactic.Item... context) { |
| 508 | if(e == null) { |
| 509 | throw new IllegalArgumentException("Syntactic item cannot be null"); |
| 510 | } |
| 511 | WyilFile wf = (WyilFile) e.getHeap(); |
| 512 | // Allocate syntax error in the heap)); |
| 513 | Syntactic.Marker m = wf.allocate(new WyilFile.Attr.SyntaxError(code, e, new Tuple<>(context))); |
| 514 | // Record marker to ensure it gets written to disk |
| 515 | wf.getModule().addAttribute(m); |
| 516 | } |
| 517 | |
| 518 | // ============================================================================= |
| 519 | // Helpers |
no test coverage detected