Split the get_method to three different entry points. These new entry points make it possible to adapt the treatment to the actual context. This avoids creating callsites manually and in the same time do the verification if the researched method exist (display an error if not exist)
Signed-off-by: Florian Deljarry <deljarry.florian@gmail.com>
Pull-Request: #2760
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
var time1 = get_time
self.toolcontext.info("*** END WRITING C: {time1-time0} ***", 2)
- if not toolcontext.check_errors then return
+ toolcontext.check_errors
# Execute the Makefile
-n -e 'print line' test_prog/README.md test_prog/test_prog.nit
test_ffi_c_interpreter.nit
-
+--keep-going test_keep_going.nit --run --dir out/
--log --log-dir $WRITE test_prog -o out/test_prog.bin
test_define.nit --semi-global -D text=hello -D num=42 -D flag --dir out/ ; out/test_define
--run ../examples/print_arguments.nit 1 2 3 --dir out/
+--keep-going test_keep_going.nit --run --dir out/
nit_args5
nit_args6
nit_args8
+nit_args9
nitvm_args1
nitvm_args3
nitin
nit_args5
nit_args6
nit_args8
+nit_args9
nitvm_args1
nitvm_args3
nitin
--- /dev/null
+\e[0;33mtest_keep_going.nit:15,11--14\e[0m: Error: class `Fail` not found in module `test_keep_going`.
+ fun plop: \e[1;31mFail\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:40,2--11\e[0m: Error: unreachable statement.
+ \e[1;31m999.output\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:26,2--5\e[0m: Error: method or variable `fail` unknown in `Sys`.
+ \e[1;31mfail\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:30,14--17\e[0m: Error: class `Fail` not found in module `test_keep_going`.
+ var x = new \e[1;31mFail\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:35,5\e[0m: Type Error: expected `Bool`, got `Int`.
+ if \e[1;31m1\e[0m then abort
+ ^
+\e[0;33mtest_keep_going.nit:44,18--21\e[0m: Error: method `fail` does not exists in `Sys`.
+ var a = new Sys.\e[1;31mfail\e[0m
+ ^
+1
+2
+3
+4
+5
+6
+7
--- /dev/null
+\e[0;33mtest_keep_going.nit:15,11--14\e[0m: Error: class `Fail` not found in module `test_keep_going`.
+ fun plop: \e[1;31mFail\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:40,2--11\e[0m: Error: unreachable statement.
+ \e[1;31m999.output\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:26,2--5\e[0m: Error: method or variable `fail` unknown in `Sys`.
+ \e[1;31mfail\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:30,14--17\e[0m: Error: class `Fail` not found in module `test_keep_going`.
+ var x = new \e[1;31mFail\e[0m
+ ^
+\e[0;33mtest_keep_going.nit:35,5\e[0m: Type Error: expected `Bool`, got `Int`.
+ if \e[1;31m1\e[0m then abort
+ ^
+\e[0;33mtest_keep_going.nit:44,18--21\e[0m: Error: method `fail` does not exists in `Sys`.
+ var a = new Sys.\e[1;31mfail\e[0m
+ ^
+Errors: 6. Warnings: 0.
+1
+2
+3
+4
+5
+6
+7