ds26gte / scmindent

87 stars 12 forks source link

Leave everything inside #| ... |# as is #12

Open iamFIREcracker opened 2 years ago

iamFIREcracker commented 2 years ago

Imagine you had a file that looked like this:

#|
I like quotes:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Nam hendrerit
    nisi sed sollicitudin pellentesque.
|#
(define hello-world ()
  (format t "Hello, world!~%"))

Feed it to lispindent and you would get back something like this (note how the last line gets aligned to the indented _quote):

#|
I like quotes:

    Lorem ipsum dolor sit amet, consectetur adipiscing elit.  Nam hendrerit
    nisi sed sollicitudin pellentesque.
    |#
(define hello-world ()
  (format t "Hello, world!~%"))

In addition, lispindent would now assume everything needed an extra 4 space of indentation -- this does not show up in the example, because the code is already properly indented.

Anyways, this commit tries to fix that by building a small state machine to handle with commented out regions: