Skip to content
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

SuccessorML syntax #47

Open
frou opened this issue Jan 11, 2022 · 8 comments
Open

SuccessorML syntax #47

frou opened this issue Jan 11, 2022 · 8 comments
Labels
enhancement New feature or request

Comments

@frou
Copy link

frou commented Jan 11, 2022

Hi there - Thanks for the nice tool.

I'm wondering what your stance is on smlfmt being able to format code that uses the SuccessorML syntax additions:

http://mlton.org/SuccessorML

Personally I like allowOptBar, allowOrPats, and allowRecordPunExps of those, and having to choose between being able to use them, and being able to autoformat code, is a tough choice!

@shwestrick
Copy link
Owner

Great suggestion. I'm definitely interested in adding these!

@shwestrick shwestrick added the enhancement New feature or request label Jan 17, 2022
@shwestrick
Copy link
Owner

Starting work on this. At the moment:

@shwestrick
Copy link
Owner

@frou These should now be working:

-allow-opt-bar true -allow-record-pun-exps true -allow-or-pats true

If you have a chance to try them out on your code, that would be really helpful. Please let me know if you encounter any problems!

I'll leave the issue open for now, because I'd like to add support for other SuccessorML features, too.

@frou
Copy link
Author

frou commented Jan 7, 2023

Sam - thank you very much. They are working, including the hints to enable them if the flags aren't given. Great stuff!

@shwestrick
Copy link
Owner

Excellent! Glad to hear.

@shwestrick
Copy link
Owner

These features can now also be controlled from within an MLB; see #73.

@frou
Copy link
Author

frou commented Jan 8, 2023

Nice. If that part gets completely built out, then I think one notable scenario to test is when the MLB author deliberately "overshoots" by enabling everything, and then backs off the one or two that they don't like, e.g.

ann
  "allowSuccessorML true"
  "allowOptSemicolon false"
in
  foo.sml
end

@shwestrick
Copy link
Owner

Cool! This makes me think that there are a lot of interesting code linting features that smlfmt could eventually offer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants