Skip to content

iterate will not break if it's directly in the body #7

@dfalbel

Description

@dfalbel

This is more like a bug in users code but... In the following code chunk, flowery won't break as expected.

library(flowery)

iter <- generator({
  for (x in letters) yield(x)
})

iterate(for(x in iter) {
  print(x)
  break
})

It's worth noting that this works as expected:

iterate(for(x in iter) {
  print(x)
  if (x == "b")
    break
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions