-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add input file contents to traceback (#666)
* Start get_traceback_entries + add convenience methos * Add fn is_call_instruction * add code * Refactor code * Clippy * Add get_traceback method * Fix get_error_attr_value * Add traceback to VmException * Make traceback non-optional * Add tests for is_call_instruction * Add traceback to error display * Add test + fix logic for get_traceback_entries * Code refactor * Add one more test for get_traceback_entries * Fix string format + add test for get_traceback * Improve fn * Add reference to is_call_instruction signature * Add reference to immediate in decode_instruction + remove clone * Fix hint_processor mutability in tests * Add Location::get_location_marks * Fix method to_string_with_contents * Fix string format * Fix string format * Update traceback tests * Add tests for Location::to_string_with_contents() * Fix intermediate string format * Fix test * Add tests for Location::get_location_marks() * Update VmException display * Fix string format * Fix string format * Remove debug print * Fix Display * Implement Display for MaybeRelocatable * Add real-case test for VmException Display * Remove debug format from erros containing MaybeRelocatable and Relocatable * Add tests for display implementation * Update Changelog * Clippy * Remove unnecessary &
- Loading branch information
Showing
6 changed files
with
280 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
%builtins range_check | ||
|
||
func check_range{range_check_ptr: felt*}(num: felt) { | ||
with_attr error_message("Failed range-check") { | ||
[range_check_ptr] = num; | ||
} | ||
return(); | ||
} | ||
|
||
func sub_1_check_range{range_check_ptr: felt*}(num: felt) -> felt { | ||
check_range(num - 1); | ||
return num - 1; | ||
} | ||
|
||
func sub_by_1_check_range{range_check_ptr: felt*}(num: felt, sub_amount: felt) { | ||
if (sub_amount == 0) { | ||
return(); | ||
} | ||
return sub_by_1_check_range(sub_1_check_range(num), sub_amount -1); | ||
} | ||
|
||
func main{range_check_ptr: felt*}() { | ||
sub_by_1_check_range(6, 7); | ||
return (); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.