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

Add attributes to sail_doc_backend output, and add syntax sugar back in docs #536

Merged
merged 1 commit into from
May 10, 2024

Conversation

Alasdair
Copy link
Collaborator

Rename to_json to json_of to better match other usages

Refactor Pretty_print_sail, adding a Pretty_print_sail.Printer functor which can be configured for different use cases. The module contains a

include Printer (Default_print_config)

so other code can just use Pretty_print_sail as before.

The main use for this is in the documentation generation, as we want to be able to format code slightly differently than when we just dump the AST for debugging, e.g. re-introduce overloads. This is handled by the resugar flag in the pretty-printer config.

The eventual ideal flow would be:

constant-propagate -> pretty_print w/ resugar -> re-parse -> format_sail

but we don't yet do the last two steps

Rename _to_json to json_of_ to better match other usages

Refactor Pretty_print_sail, adding a Pretty_print_sail.Printer functor
which can be configured for different use cases. The module contains a

include Printer (Default_print_config)

so other code can just use Pretty_print_sail as before.

The main use for this is in the documentation generation, as we want
to be able to format code slightly differently than when we just dump
the AST for debugging, e.g. re-introduce overloads. This is handled by
the `resugar` flag in the pretty-printer config.

The eventual ideal flow would be:

constant-propagate -> pretty_print w/ resugar -> re-parse -> format_sail

but we don't yet do the last two steps
Copy link

github-actions bot commented May 10, 2024

Test Results

    9 files  ±0     20 suites  ±0   0s ⏱️ ±0s
  625 tests ±0    625 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 006 runs  ±0  2 005 ✅ ±0  1 💤 ±0  0 ❌ ±0 

Results for commit 5cef14c. ± Comparison against base commit 360baf9.

♻️ This comment has been updated with latest results.

@Alasdair Alasdair merged commit 2725bc8 into sail2 May 10, 2024
9 checks passed
@Alasdair Alasdair deleted the doc_resugar branch May 10, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant