Skip to content

Accept a comment at the end of a file - #901

Merged
phdoerfler merged 1 commit into
mainfrom
fix/f13-trailing-comment
Aug 20, 2026
Merged

Accept a comment at the end of a file#901
phdoerfler merged 1 commit into
mainfrom
fix/f13-trailing-comment

Conversation

@hugo-vrijswijk

Copy link
Copy Markdown
Contributor

The comment parser required a line terminator after the comment text. A comment at the end of the file has none, so the whole document failed to parse.

The terminator is now charIn('\n', '\r') | Parser.end.

@phdoerfler phdoerfler left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aside from the comment-only test it looks good. The GraphQL grammar ends a comment at the end of the input as well as at a LineTerminator, so this matches the spec.

Comment thread modules/core/src/test/scala/parser/ParserSuite.scala Outdated
The comment parser required a line terminator after the comment text. A comment at the end of the file has none, so the whole document failed to parse.

The terminator is now `charIn('\n', '\r') | Parser.end`.
@hugo-vrijswijk
hugo-vrijswijk force-pushed the fix/f13-trailing-comment branch from 41fdbc7 to 0b1999b Compare August 20, 2026 08:03
@phdoerfler
phdoerfler merged commit f147462 into main Aug 20, 2026
23 checks passed
@phdoerfler
phdoerfler deleted the fix/f13-trailing-comment branch August 20, 2026 08:48
@phdoerfler

Copy link
Copy Markdown
Contributor

LGTM, thanks!

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