Commit Graph

8 Commits

Author SHA1 Message Date
Greg Pfeil
0031542faf
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still
pretty-print ourselves will match the bulk of them that `cmark`
produces.
2024-07-10 13:56:07 -06:00
Greg Pfeil
1dc181b99a
Update the transcripts with cmark
`cmark`’s pretty-printer matches our output pretty well, with a few differences:
- it puts a space between the fence and the info string for in code blocks;
- it prefers `-` over `*` for bulleted lists (as do I) and it indents them;
- it `\`-escapes certain chars very conservatively;
- it prefers indented/unfenced code blocks if there is no info string; and
- it prefers `*` over `_` (unlike any sane person).

This also shows how the change fixes a number of issues:
- fix2158-1.output.md also illustrates how this change fixes #1809;
- alias-many.output.md and input-parse-errors.output.md show how fenced
  code blocks without an info string would use the beginning of the
  content as the info string;
- transcripts-round-trip/main.output.md shows how output blocks for
  generated `unison` stanzas (which could contain nested fenced blocks)
  might not have long-enough fences; and
- error-messages.output.md and generic-parse-errors.output.md show how
  Unison errors were reported on the wrong line number (and thus the
  printed error lines were also incorrect).
2024-07-10 13:37:51 -06:00
andrii
8b857b152c Adding a message for when ucm started reloading changes 2023-12-22 12:55:24 +01:00
Paul Chiusano
7509e3efa1 refresh transcripts 2023-07-21 02:12:22 -04:00
Rúnar
d9cdf6b40b Fix roundtrip error with block lambdas 2023-03-03 21:03:40 -05:00
Dan Doel
4a28b0d064 Fix a corner case in new 'beta-reduced' decompilation
- The check was looking for occurrences of `f x y z ...` to make sure it
  was safe to eliminate variables that had been added by enclosure.
  However, it wasn't finding occurrences of `f` by itself, because that
  is not considered an application by the predicate that was being used.

- I also made the 'fix-up' code default to not eliminating any variables
  when there are *no* subsequent occurrences of `f`. Previously this
  would allow eliminating as many variables as possible. However, this
  can produce ill-scoped definitions. Avoiding this would require
  knowing which variables are in scope when reducing an unused
  definition, but that would require a more complicated rewriting
  process than is currently used.
2022-12-07 12:06:56 -05:00
Dan Doel
bc7d5386ef Some tweaks and an improved test case
- visit_ was producing problematic results, because it visits every
  subexpression. This means that for:

    f x y z

  it visits all of:

    f x y z, f x y, f x, f

  But, if we take prefixes for all of those, we'll always end up
  eliminating only one variable, even if more are redundant.
- Instead of the above, use `visit` with a recursive procedure. This
  requires some other modifications, because we need to manually recurse
  into arguments of applied functions that aren't variables.
- Added a test case for the above trickiness
- Prefix should have been a newtype
2022-11-02 11:21:36 -04:00
Dan Doel
100947daa6 Test case 2022-11-02 10:39:35 -04:00