From 4f0d427264b1a4edae6fcfa09a67aa7df0fb1918 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 25 Apr 2017 12:02:25 -0400 Subject: [PATCH] nitc: document add_raw_abort Signed-off-by: Jean Privat --- src/compiler/abstract_compiler.nit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index 0d04167..9aea519 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -1832,10 +1832,14 @@ abstract class AbstractCompilerVisitor add_raw_abort end + # Generate abort without a message. + # + # Used when one need a more complex message. fun add_raw_abort do - if self.current_node != null and self.current_node.location.file != null and - self.current_node.location.file.mmodule != null then + var current_node = self.current_node + if current_node != null and current_node.location.file != null and + current_node.location.file.mmodule != null then var f = "FILE_{self.current_node.location.file.mmodule.c_name}" self.require_declaration(f) self.add("PRINT_ERROR(\" (%s:%d)\\n\", {f}, {current_node.location.line_start});") -- 1.7.9.5