-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
Add formatting for records #1
Conversation
currently, some tests are failing because - i'm not sure what the "correct" formatting is - and how to handle spaces (especially newlines) Perhaps it's OK to ignore newlines for now, and just always start with `{<space>` and close with `<space>}`?
Cool! I pushed some stuff:
|
I've also been rethinking whether block comments are a good idea; I'm not sure I'll keep them in the language. (e.g. Python doesn't have them, so there's precedent for that being a reasonable design decision.) The tests with the comments in unusual places are good though! I'd just change them to be line comments, so newlines are in the mix too. |
src/parse/ast.rs
Outdated
LabeledValue(name, spaces, value) => { | ||
buf.push_str(name.value); | ||
|
||
if spaces.len() > 0 { |
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 think !spaces.is_empty()
would be better here (and also below)
I think the single-line case works correctly now. Multi-line requires a bit more work. I think in those cases newlines from the document should be ignored completely. Also that logic is probably the same for records and lists? anyhow should multi-line formatting be part of this PR? |
currently, some tests are failing because
Perhaps it's OK to ignore newlines exist for now, and always start with
{<space>
and close with<space>}
?