Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow end-of-line comments #162

Closed
11 tasks done
avh4 opened this issue May 7, 2016 · 6 comments
Closed
11 tasks done

Allow end-of-line comments #162

avh4 opened this issue May 7, 2016 · 6 comments
Assignees
Milestone

Comments

@avh4
Copy link
Owner

avh4 commented May 7, 2016

A -- comment at the end of a line should be attached to the preceding token instead of to the subsequent token.

  • after record fields in types
  • after record fields in expressions
  • after values in list expressions
  • after values in tuple expressions
  • after entries in tuple types
  • union type definitions
  • after record fields in record updates
  • after record fields in record extension types
  • in function types
  • in binary operator expressions
  • in cons patterns
  • ? tag arguments in types (Tag --z\n a --x\n b --y\n)
  • ? case branches
  • ? if/else branchs
  • ? let definitions
  • ? top-level definitions
@avh4 avh4 modified the milestones: 0.3.0 public beta candidate, 0.4.0 public beta May 7, 2016
@ghost
Copy link

ghost commented Jun 23, 2016

Is that this?
screen shot 2016-06-23 at 22 20 12

@avh4
Copy link
Owner Author

avh4 commented Jun 24, 2016

yep, the goal is to get the uid field and comment to all stay on one line.

@avh4
Copy link
Owner Author

avh4 commented Mar 6, 2017

Initial attempt implemented in a495484...07afe63

What other places in the syntax do end-of-line comments need to be handled?

@avh4
Copy link
Owner Author

avh4 commented Mar 8, 2017

Implemented for union type declarations in 080cb9a...f9e2f8c

@avh4
Copy link
Owner Author

avh4 commented Mar 11, 2017

Implemented for binary operators, function types, and cons patterns in 515ca02...3532eb6

@avh4
Copy link
Owner Author

avh4 commented Mar 19, 2017

I'm still debating whether it's good to allow this in all the places I added it for... For instance, having end-of-line comments after items in a list literal: is that a place where we should instead be encouraging refactoring?

In any case, all the TODOs for this have been implemented. Marking as resolved.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant