Fix #284 #316
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/nac3#316
Loading…
Reference in New Issue
No description provided.
Delete Branch "issue-284"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the issue where, if the loop variable is used after a
range
loop, the value would be off by one.This MR fixes the problem by rewriting
range
loops into a do-while loop similar toThis MR also implements the behavior where when 0 is provided to the
step
argument ofrange
, aValueError
will be raised.In addition, some minor code cleanup has also been performed, namely
Add statement type to basic block label names
Add variable name to IR variables if able
Refactored the loop logic for iterables case to align with the standard C-style loop
@ -83,24 +83,49 @@ pub trait CodeGenerator {
/// Allocate memory for a variable and return a pointer pointing to it.
/// The default implementation places the allocations at the start of the function.
fn gen_var_alloc_named<'ctx, 'a>(
Instead of two functions, just add the name parameter to gen_var and refactor the code to pass None. Would be another PR.
Created #317 to address this issue.
18a3263af1
to4481d48709
Rebased against
master
. Ready for re-review.