Closed littlewhitecloud closed 1 year ago
-compiler error in file "tests/other_errors/function_wrong_n_args.jou", line 4: function getchar() takes 0 arguments, but it was called with 1 argument
-Exit code: 1
+bash: line 1: 3861 Segmentation fault (core dumped) ./jou -O3 tests/other_errors/function_wrong_n_args.jou
Oh, no, segmentation fault
-compiler error in file "tests/syntax_error/missing_self.jou", line 2: error when defining method bar() bacause it has no self +compiler error in file "tests/syntax_error/missing_self.jou", line 7: error when defining method bar() bacause it has no self
This means that the error is reported on the wrong line. The compiler actually reports an error on line 7, but according to the test it should be reported on line 2.
my idea: create a new flag named selfused, and if it doesn't true after the "while" loop and accept_self is true, I will give an parse_error
Now the problem is: how can I get this function name for showing the error
You can use result.name
.
Now add the same error message in the self-hosted compiler :)
finally...
fix #244