[GH-ISSUE #36] Inline Comments? #13

Open
opened 2026-05-22 22:05:09 +01:00 by JakeStanger · 2 comments
Owner

Originally created by @zyansheep on GitHub (Feb 16, 2025).
Original GitHub issue: https://github.com/corn-config/corn/issues/36

It would be nice to have inline comments I think.

Something like:

$list = [ /* item1 */ item2 item3 ]

Any thoughts?

Originally created by @zyansheep on GitHub (Feb 16, 2025). Original GitHub issue: https://github.com/corn-config/corn/issues/36 It would be nice to have inline comments I think. Something like: ```corn $list = [ /* item1 */ item2 item3 ] ``` Any thoughts?
Author
Owner

@JakeStanger commented on GitHub (Mar 5, 2025):

I've given it some thought, and yes I think this would be good to have.

<!-- gh-comment-id:2701433942 --> @JakeStanger commented on GitHub (Mar 5, 2025): I've given it some thought, and yes I think this would be good to have.
Author
Owner

@rdin777 commented on GitHub (Dec 17, 2025):

Subject: Analysis of existing COMMENT rule in grammar.pest

"Hi everyone!

I've been looking into this issue and noticed that the src/grammar.pest file already contains a COMMENT rule: COMMENT = _{ "//" ~ (!"\n" ~ ANY)* }.

In the Pest parser, WHITESPACE and COMMENT rules are typically implicit between other rules. However, I’d like to clarify a few points to better understand the current blocker:

Inline Behavior: Does the current implementation fail when a comment is placed on the same line as a value (e.g., key = "value" // comment)?

Atomic Rules: Are there any specific atomic rules (like strings or paths) where the comment might be interfering or failing to be ignored?

Parser Integration: Is the COMMENT rule correctly handled in the src/parser.rs (or equivalent) when generating the AST, or is it currently being skipped entirely?

I'm interested in helping to fix the implementation if the foundation is already there. Looking forward to your thoughts!"

<!-- gh-comment-id:3664089098 --> @rdin777 commented on GitHub (Dec 17, 2025): Subject: Analysis of existing COMMENT rule in grammar.pest "Hi everyone! I've been looking into this issue and noticed that the src/grammar.pest file already contains a COMMENT rule: COMMENT = _{ "//" ~ (!"\n" ~ ANY)* }. In the Pest parser, WHITESPACE and COMMENT rules are typically implicit between other rules. However, I’d like to clarify a few points to better understand the current blocker: Inline Behavior: Does the current implementation fail when a comment is placed on the same line as a value (e.g., key = "value" // comment)? Atomic Rules: Are there any specific atomic rules (like strings or paths) where the comment might be interfering or failing to be ignored? Parser Integration: Is the COMMENT rule correctly handled in the src/parser.rs (or equivalent) when generating the AST, or is it currently being skipped entirely? I'm interested in helping to fix the implementation if the foundation is already there. Looking forward to your thoughts!"
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
corn-config/corn#13
No description provided.