[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Getting source location information
From: |
Ludovic Courtès |
Subject: |
Re: Getting source location information |
Date: |
Wed, 30 Nov 2005 17:04:28 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Bruce Korb <address@hidden> writes:
> That read function reads an s-expr. How can that work if
> the non-Scheme text in the file is not an s-expr? I don't see another
> function for getting text from a port. Am I missing something?
> Especially troubling is the phrase, "Any whitespace before the
> next token is discarded." I do not want tokenized input. I want raw
> text. I have my own methods for determining when something needs
> a Scheme evaluation.
That the input file does not contain only Scheme source wasn't clear to
me. Then, in fact, it would make sense to use `scm_c_eval_string ()',
provided your tool is able to determine the boundaries of the Scheme
expression (if it's not, you'd better use `scm_read ()').
After the `scm_c_eval_string ()', you can `printf ()' whatever location
information you want. If you want to use source locations in a
Guile-friendly way (so that Guile can, for instance, display location
information in backtraces), then you may want to use
`scm_set_source_property_x (sexp, key, datum)' (where KEY may be one of
SCM_SYM_FILENAME, SCM_SYM_LINE, SCM_SYM_COLUMN) which is defined in
`srcprop.h'.
But again, this is a problem (and a solution) relevant to your tool, not
to Guile in general.
Thanks,
Ludovic.
- I don't want to maintain this, Bruce Korb, 2005/11/27
- I don't want to maintain this, Bruce Korb, 2005/11/28
- Re: I don't want to maintain this, Ludovic Courtès, 2005/11/29
- Re: I don't want to maintain this, Bruce Korb, 2005/11/29
- Re: I don't want to maintain this, Ludovic Courtès, 2005/11/30
- Re: I don't want to maintain this, Bruce Korb, 2005/11/30
- Re: I don't want to maintain this, Ludovic Courtès, 2005/11/30
- Re: I don't want to maintain this, Bruce Korb, 2005/11/30
- Getting source location information, Ludovic Courtès, 2005/11/30
- Re: Getting source location information, Bruce Korb, 2005/11/30
- Re: Getting source location information,
Ludovic Courtès <=
- Re: Getting source location information, Bruce Korb, 2005/11/30
- Re: Getting source location information, Ludovic Courtès, 2005/11/30
- Re: Getting source location information, Rob Browning, 2005/11/30
- Re: Getting source location information, Bruce Korb, 2005/11/30
- Re: Getting source location information, Rob Browning, 2005/11/30
- Re: Getting source location information, Bruce Korb, 2005/11/30
- Re: Getting source location information, Han-Wen Nienhuys, 2005/11/30
Re: I don't want to maintain this, Kevin Ryde, 2005/11/30
Re: I don't want to maintain this, Kevin Ryde, 2005/11/30