Skip to content

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

Open

Description

@sorawee
@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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions