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

Update comment lexing to match #198. #292

Merged
merged 2 commits into from
Feb 26, 2021
Merged

Update comment lexing to match #198. #292

merged 2 commits into from
Feb 26, 2021

Conversation

zygoloid
Copy link
Contributor

No description provided.

@zygoloid zygoloid requested a review from chandlerc February 24, 2021 02:06
@google-cla google-cla bot added the cla: yes PR meets CLA requirements according to bot. label Feb 24, 2021
struct NoWhitespaceAfterCommentIntroducer {
static constexpr llvm::StringLiteral ShortName = "syntax-comments";
static constexpr llvm::StringLiteral Message =
"Whitespace is required after '//'.";
Copy link

Choose a reason for hiding this comment

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

nit: should we use markdown ` for quoting code in a message?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've asked for opinions in #toolchain, but I'd be happy with that as a convention.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, I'm very supportive of generally using markdown notation in diagnostics where it fits. Markdown even has plausible nesting if/where we need it.

Copy link
Contributor

@chandlerc chandlerc left a comment

Choose a reason for hiding this comment

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

LGTM generally. Happy for the use of ``` to land here or in a follow-up PR.

struct NoWhitespaceAfterCommentIntroducer {
static constexpr llvm::StringLiteral ShortName = "syntax-comments";
static constexpr llvm::StringLiteral Message =
"Whitespace is required after '//'.";
Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, I'm very supportive of generally using markdown notation in diagnostics where it fits. Markdown even has plausible nesting if/where we need it.

@zygoloid zygoloid merged commit b86f7f2 into carbon-language:trunk Feb 26, 2021
@zygoloid zygoloid deleted the comments branch February 27, 2021 02:05
chandlerc pushed a commit that referenced this pull request Jun 28, 2022
Require a space after a `//`, and recognize but reject a `//` that follows non-whitespace text in the same line. Remove DocComment token kind that ended up not being part of the design.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes PR meets CLA requirements according to bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants