Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added outermost loop to JSON #694

Merged
merged 3 commits into from
Sep 15, 2023
Merged

Added outermost loop to JSON #694

merged 3 commits into from
Sep 15, 2023

Conversation

sternj
Copy link
Collaborator

@sternj sternj commented Sep 13, 2023

Added a new pair of fields to JSON, start_outermost_loop and end_outermost_loop, which keeps track of the outermost loop in the current scope that a given line belongs to. For instance,

for i in a:
   for j in b:
      for k in c:
         pass

The pass statement in the above snippet would be reported as being contained in the outermost for loop, which iterates over i. However,

for i in a:
   def b():
      for j in c:
         pass

the pass statement in the above snippet would be said to have an outermost for loop for j in c:, since the loop iterating over i is not in the same scope.

scalene/scalene_analysis.py Outdated Show resolved Hide resolved
scalene/scalene_analysis.py Outdated Show resolved Hide resolved
scalene/scalene_analysis.py Show resolved Hide resolved
@emeryberger emeryberger merged commit 2e0961e into master Sep 15, 2023
10 checks passed
@emeryberger emeryberger deleted the add_outermost_loop branch September 18, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants