-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Terminate :statement parsing at newlines #493
Conversation
Addresses a portion of #316
test/hooks.jl
Outdated
# Issue #81 | ||
f() = nothing | ||
""" | ||
@test JuliaSyntax.core_parser_hook(stmtstr, "somefile", 1, 0, :statement)[2] ∈ 19:21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the range 19:21
for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see that there's a truly unique "right" answer. So I was allowing anything that parses all the code but terminates before the comment starts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh I see :)
If we're choosing a particular somewhat-arbitrary but well-defined behavior I'd prefer to be precise with the test so we can detect any unexpected changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I went with 19, which is the earliest this can terminate. I believe this probably matches the flisp parser, but not sure.
I wrote a "wide" test initially because of the annoyances I've experienced over time maintaining tests sensitive to what turn out to be irrelevant details (e.g., whether you add a space between elements when printing tuples). So I've sometimes started to ask, "what behavior do I most care about, and what's the widest test I can write that still enforces that behavior?" But I fully understand where you're coming from here, and it probably makes sense given that this is the origin of such choices rather than the receiver of such choices.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #493 +/- ##
==========================================
+ Coverage 96.21% 96.54% +0.32%
==========================================
Files 13 13
Lines 4171 4193 +22
==========================================
+ Hits 4013 4048 +35
+ Misses 158 145 -13 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Tim! LGTM :-)
Addresses a portion of #316