Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

all: add break & continue loop actions #4

Closed
wants to merge 1 commit into from

Conversation

jo3-l
Copy link
Contributor

@jo3-l jo3-l commented Apr 16, 2021

Description
This implements break and continue actions for range and while loops, along with tests. It's mostly taken from https://go-review.googlesource.com/c/go/+/66410/ with some edits to support while actions. The above commit was reverted due to issues with html/template (see golang/go#23683). However, as we don't have such issues, there should be no issue adding it to this fork.

There is also a newer CL that implements it upstream (not merged); see the comment below for why that approach is not used here.

Status
Tests are all passing except the newline ones mentioned earlier, which are unrelated to this PR.

@jo3-l jo3-l force-pushed the feat/break-continue-actions branch from 2f3edbb to 0df4ec2 Compare April 16, 2021 18:12
@jo3-l jo3-l force-pushed the feat/break-continue-actions branch from 0df4ec2 to d1f133b Compare April 16, 2021 19:14
@jo3-l jo3-l marked this pull request as draft April 16, 2021 23:34
@jo3-l jo3-l force-pushed the feat/break-continue-actions branch from d1f133b to 5d6c3e7 Compare April 16, 2021 23:56
@jo3-l jo3-l marked this pull request as ready for review April 17, 2021 01:43
@jo3-l
Copy link
Contributor Author

jo3-l commented Jun 6, 2021

Re-drafting this as https://go-review.googlesource.com/c/go/+/321491/1/src/text/template/exec.go - a new CL implementing break/continue upstream - uses a different, far simpler approach than the original PR this was inspired by, which I'd like to change this PR to use as well.
Had to roll back these changes after trying a similar technique with the return/execTemplate PR, which caused a ~50x performance regression in self-calling associated templates. This will still use the old approach for that reason.

@jo3-l jo3-l marked this pull request as draft June 6, 2021 21:27
@jo3-l jo3-l force-pushed the feat/break-continue-actions branch 3 times, most recently from 77c204a to 5e3d6e7 Compare June 7, 2021 05:37
@jo3-l jo3-l marked this pull request as ready for review June 7, 2021 05:59
@jo3-l jo3-l force-pushed the feat/break-continue-actions branch from 5e3d6e7 to d023055 Compare June 12, 2021 18:56
@ashishjh-bst
Copy link
Contributor

Has conflicts after the try catch and while features have been merged @jo3-l

@jo3-l jo3-l force-pushed the feat/break-continue-actions branch from d023055 to 74b3d6b Compare April 3, 2022 17:50
@jo3-l
Copy link
Contributor Author

jo3-l commented Apr 3, 2022

Rebased.

@ashishjh-bst
Copy link
Contributor

@jo3-l has conflicts again after merging your Other PR, I'll merge this one and then use the version after merging this PR for monorepo.

@jo3-l
Copy link
Contributor Author

jo3-l commented Apr 10, 2022

The other PR is a superset of this one (it builds on this) so since that's merged there's no need for this one. Closing.

@jo3-l jo3-l closed this Apr 10, 2022
@mrbentarikau
Copy link

mrbentarikau commented Apr 10, 2022

just interested, what Other PR, thnx...
is it #6?

@jo3-l
Copy link
Contributor Author

jo3-l commented Apr 11, 2022

Yes, I was referring to #6 in my previous message.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants