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

Require space, semicolon, or newline after class/module/etc. header #13375

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

FnControlOption
Copy link
Contributor

Originally included in #11854

Closes #11209

Unrelated, a lot of tests in describe "end locations" do ... end don't have anything to do with, well, end locations.

@Blacksmoke16 Blacksmoke16 added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser labels Apr 21, 2023
Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

Have you considered extracting skip_space out of parse_path/parse_generic? Most calls to these methods are already followed by an explicit call to skip_space. So maybe we could do this everywhere and reduce some complexity?

This is just an idea. I haven't actually tried it and maybe it won't work well. It's not a requirement for merging.

spec/compiler/parser/parser_spec.cr Outdated Show resolved Hide resolved
@FnControlOption FnControlOption changed the title Require space, semicolon, or newline after class/module header Require space, semicolon, or newline after type def header May 2, 2023
@FnControlOption FnControlOption changed the title Require space, semicolon, or newline after type def header Require space, semicolon, or newline after class/module/etc. header May 2, 2023
@FnControlOption FnControlOption marked this pull request as ready for review May 2, 2023 17:54
Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

I noticed another minor thing.

Again, it's not a requirement, but I think it would improve code quality a bit.

src/compiler/crystal/syntax/parser.cr Outdated Show resolved Hide resolved
@beta-ziliani
Copy link
Member

We should add specs with the expected valid cases in order to not run again with the same issue that forced the reverting of #11209.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single colon delimiter works in type names
5 participants