Skip to content

Conversation

@karoliineh
Copy link
Member

Solves #183

The parser now captures distinct location ranges for each component of the for loop, e.g.:

  • Initialization: int i = 0
  • Condition: i < 5
  • Increment: i++

Changes

  • Made for_clause grammar rule to return location ranges
  • Updated FOR statement to track separate locations for initialization, condition, and increment
  • Updated cabs2cil to use the component-specific locations when processing each part
  • Updated affected visitor and printer functions

Restore currentLoc and currentExpLoc after the doDecl call in the FOR statement handler to prevent the increment expression from inheriting the initialization location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants