Skip to content

Conversation

@perrero
Copy link

@perrero perrero commented Feb 14, 2024

Added test t/01-Parser.t and simple workaround for dropped continue operator functionality in 'given-when' statement.

@perrero perrero changed the title restoring parser execution flow after abandoning given-even operators and test for parser restoring parser execution flow after abandoning given-when operators and test for parser Feb 14, 2024
@richterger
Copy link
Owner

What is the problem your fix should solve? As far as I read the code the removed containue statement did nothing anyway in the past?
Do you have a test case that fails without your modification and work with the fix?

@perrero
Copy link
Author

perrero commented Jan 12, 2025

What is the problem your fix should solve?

The problem is in the parser's generation of a token with the package name. This adds support for quickly jumping to a module by module name in VSCODE (via Ctrl+T).

As far as I read the code the removed containue statement did nothing anyway in the past?

Instead of a continue operator, a block is named with a label FINISH_BLOCK and a GOTO FINISH_BLOCK operator is used. It's not pretty, but it works (sorry, but I can't think of a better replacement for the lost functionality of "given-when" for this case).

Do you have a test case that fails without your modification and work with the fix?

Yes, file t/01-Parser.t contains the required case, the first token without a patch looks like this {name='main::'}, and with a patch - like this {name='My::Package'}.

Thank you from the community for this useful tool!

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