unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: 39854@debbugs.gnu.org
Subject: bug#39854: Not correct line and column numbers associated to function.
Date: Sun, 1 Mar 2020 13:17:32 +0100	[thread overview]
Message-ID: <CAGua6m048qEZz03SfQaARX9xrH3WVTSH7SP0q_M_AZy1kzCN+A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

Consider this source file: test.scm:

(use-modules (language python def) (system syntax internal) ((oop dict)
#:select (slask-it)))

(define-syntax m
  (lambda (x)
    (syntax-case x ()
      ((_ n m y)
       (let* ((xx (syntax-expression x))
              (yy (pk 'yy (source-properties xx)))
              (zz (syntax-expression #'y))
              (ww (pk 'ww (source-properties zz)))
              (nn (assoc 'line   yy))
              (mm (assoc 'column yy))
              (ii (assoc 'line   ww))
              (jj (assoc 'column ww)))
         (if nn (set-cdr! nn (syntax->datum #'n)))
         (if mm (set-cdr! mm (syntax->datum #'m)))
         (if ii (set-cdr! ii (syntax->datum #'n)))
         (if jj (set-cdr! jj (syntax->datum #'m)))
         (set-source-properties! xx (pk yy))
         (set-source-properties! zz (pk ww))
         #'y)))))

(define f (slask-it (lambda () 1)))

;;-----------------------------------------------------

Never mind the m macro and concentrate on the last define of f. slask-it is
an imported function
and equivalent to (lambda (x) x) (just to make sure to annynmous f. loading
this source file an d quiring f lead to

cheme@(guile-user)> f
$10 = #<procedure 7fa3c1db93b0 at test.scm:4:2 ()>

Why 4:2? the line number is much higher and column number as well.

Regards
Stefan

[-- Attachment #2: Type: text/html, Size: 1994 bytes --]

             reply	other threads:[~2020-03-01 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 12:17 Stefan Israelsson Tampe [this message]
2020-03-05 21:54 ` bug#39854: Not correct line and column numbers associated to function Ludovic Courtès

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=CAGua6m048qEZz03SfQaARX9xrH3WVTSH7SP0q_M_AZy1kzCN+A@mail.gmail.com \
    --to=stefan.itampe@gmail.com \
    --cc=39854@debbugs.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).