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

fix: fix angular control block after @for #78

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

electricentity
Copy link
Contributor

@electricentity electricentity commented Nov 12, 2024

For angular @for control blocks the subsequent @empty is optional (doc) but it was being enforced as the next control block after a @for.

Tried to modify in alignment with how parse_angular_if was handling the optional subsequent control blocks.

Happy to fix up or or tweak as I didn't engage with too much of this code base when trying to fix this but it did resolve the errors I was getting when running on an Angular code base.

Output of added test cases without the code changes:

called `Result::unwrap()` on an `Err` value: "failed to format '.../markup_fmt/markup_fmt/tests/fmt/angular/control-flow/for.component.html': Syntax(SyntaxError { kind: ExpectKeyword(\"empty\"), pos: 467, line: 27, column: 3 })"

Copy link
Owner

@g-plane g-plane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@g-plane g-plane merged commit feca4a0 into g-plane:main Nov 13, 2024
2 checks passed
@electricentity
Copy link
Contributor Author

@g-plane lol, thanks for cleaning up my logic. I definitely should have taken a step back to reflect after getting it working

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