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 a ppx for snarky with_label #1362

Merged
merged 8 commits into from Dec 28, 2018

Conversation

Projects
None yet
2 participants
@mrmr1993
Copy link
Contributor

mrmr1993 commented Dec 21, 2018

This PR

  • adds [%with_label label], that expands to with_label (label ^ ": " ^ __LOC__)
  • adds let%snarkydef name arg = ..., that expands to let name arg = with_label ("name: " ^ __LOC__) ...
  • replaces the simplest cases (with_label __LOC__ at the top of a function definition) with let%snarkydef ... = ....
    • The diffs are overinflated by the formatter after this change; git diff -w (or here) gives a much more representative view of what is actually different.

Checklist:

  • Tests were added for the new behavior
  • All tests pass (CI will check this if you didn't)
  • Does this close issues? List them:

mrmr1993 added some commits Dec 21, 2018

Add extremely basic with_label ppx
This expands [%with_label expr] to
  with_label (expr ^ ": " ^ Pervasives.__LOC__)

@mrmr1993 mrmr1993 requested a review from imeckler Dec 21, 2018

mrmr1993 and others added some commits Dec 21, 2018

@imeckler
Copy link
Contributor

imeckler left a comment

This is so cool!

@mrmr1993 mrmr1993 merged commit 775a434 into master Dec 28, 2018

8 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build_public Your tests passed on CircleCI!
Details
ci/circleci: build_withsnark Your tests passed on CircleCI!
Details
ci/circleci: test-all_sig_integration_tests Your tests passed on CircleCI!
Details
ci/circleci: test-all_stake_integration_tests Your tests passed on CircleCI!
Details
ci/circleci: test-unit-test Your tests passed on CircleCI!
Details
ci/circleci: test-withsnark Your tests passed on CircleCI!
Details
ci/circleci: tracetool Your tests passed on CircleCI!
Details

@mrmr1993 mrmr1993 deleted the snarky-label-ppx branch Jan 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment