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

Use syntax-span and syntax-position to compute the tail space in a list #386

Open
sorawee opened this issue Dec 9, 2023 · 0 comments
Open

Comments

@sorawee
Copy link
Contributor

sorawee commented Dec 9, 2023

@racketblock[( a   b   cde  )]

is currently rendered as:

( a   b   cde)

The spaces between "cde" and ")" are missing.

One possible fix:

  • use syntax-position to find that the position of "( a .... )" is x with the span of 16
  • use syntax-position to find that the position of "cde" is x + 10 with the span of 3
  • So there should be 16 - ((x + 10) - x) - 3 - 1 = 2 spaces between "cde" and ")".
  • More generally: the quantity is whole-span - (last-pos - whole-pos) - last-span - 1.
  • The spaces must be added before ")" is written. Somewhere before
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant