unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guile-user@gnu.org
Subject: Re: Syntax locations are ambiguous: can we track source 'offset' and 'length'?
Date: Wed, 04 Aug 2021 14:05:59 +0200	[thread overview]
Message-ID: <87v94lpg7s.fsf@gnu.org> (raw)
In-Reply-To: 771a6e88782e288143be269b14751b761523e4c1.camel@planete-kraus.eu

Hi Vivien,

Vivien Kraus via General Guile related discussions <guile-user@gnu.org>
skribis:

> I am trying to use the guile reader to read scheme comments, in
> addition to the syntax elements. I know with syntax-source where a
> syntax object starts, and I can know where it ends by using a spying
> soft port and re-reading it. However, the #\return ambiguity makes all
> my efforts pointless.

As you know, ‘read-syntax’ appeared in 3.0.7, so it’s brand new and we
could certainly extend (ice-9 read) with more features, including
reading comments.

In the meantime, I needed the ability to read comments in Guix,
including with Guile < 3.0.7, so I hacked up this thing:

  https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/style.scm?h=core-updates&id=8419221620191d2988c22f6e7811d9ce1e0837bf#n50

It can read and write while preserving comments.

Again, we could/should probably integrate that functionality in (ice-9
read) eventually, it shouldn’t be too hard.

Thanks,
Ludo’.




  parent reply	other threads:[~2021-08-04 12:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 22:50 Syntax locations are ambiguous: can we track source 'offset' and 'length'? Vivien Kraus via General Guile related discussions
2021-08-03 19:29 ` Linus Björnstam
2021-08-03 23:51   ` Vivien Kraus via General Guile related discussions
2021-08-04  1:20     ` Keith Wright
2021-08-04 10:01       ` Vivien Kraus via General Guile related discussions
2021-08-04 12:05 ` Ludovic Courtès [this message]
2021-08-04 12:25   ` Vivien Kraus via General Guile related discussions
2021-08-04 13:41     ` Ludovic Courtès
2021-08-04 14:09       ` Vivien Kraus via General Guile related discussions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v94lpg7s.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).