unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* [bug #31234] [1.9.12] errors in macroexpand don't give line numbers of source
@ 2010-10-03 18:08 Mike Gran
  2010-11-16  1:57 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Gran @ 2010-10-03 18:08 UTC (permalink / raw)
  To: Mike Gran, bug-guile


URL:
  <http://savannah.gnu.org/bugs/?31234>

                 Summary: [1.9.12] errors in macroexpand don't give line
numbers of source
                 Project: Guile
            Submitted by: mike121
            Submitted on: Sun 03 Oct 2010 06:08:46 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Hi-

Sometimes syntax errors in the macro expander don't give enough info to
locate the error.

If I create a file that contains 

(define (func)
  (let ((val #t))
    (if val
        0
        1
        2)))

I load the file, Guile reports the syntax error, but, it doesn't give a line
number.  Obviously I could find the error in this trivial example, but, it
longer source code files, it would be nice to know the line number.

Below is the non-autocompiled outputs.  The autocompiled
output is similar.

$ GUILE_AUTO_COMPILE=0 guile --debug -s tmp.scm
Backtrace:
In ice-9/boot-9.scm:
 170: 19 [catch #t #<catch-closure 8388710> ...]
In unknown file:
   ?: 18 [catch-closure]
In ice-9/boot-9.scm:
  62: 17 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
 389: 16 [eval # #]
In ice-9/boot-9.scm:
1844: 15 [save-module-excursion #<procedure 83c74e0 at
ice-9/boot-9.scm:1857:3 ()>]
1153: 14 [load "tmp.scm" #f]
1051: 13 [%start-stack load-stack ...]
1056: 12 [#<procedure 83c7450 ()>]
In unknown file:
   ?: 11 [primitive-load "tmp.scm"]
In ice-9/eval.scm:
 458: 10 [#<procedure 82a7d60 at ice-9/eval.scm:451:4 (exp)> (define # #)]
In ice-9/psyntax.scm:
1147: 9 [chi-top (define (func) (let (#) (if val 0 ...))) () ...]
1504: 8 [chi-simple-lambda (# . #) () (()) ...]
1394: 7 [parse (((#) . #(syntax-object # # #))) () () () () () ()]
In unknown file:
   ?: 6 [map #<procedure 83c7378 at ice-9/psyntax.scm:1393:50 (x)> ((# .
#))]
In ice-9/psyntax.scm:
2008: 5 [chi-let (let ((val #t)) (if val 0 ...)) (("placeholder"
placeholder)) ...]
1394: 4 [parse (((# # #) . #(syntax-object # # #))) () () () () () ()]
In unknown file:
   ?: 3 [map #<procedure 83c72b8 at ice-9/psyntax.scm:1393:50 (x)> ((# .
#))]
   ?: 2 [scm-error syntax-error macroexpand ...]
In ice-9/boot-9.scm:
 115: 1 [#<procedure 834e460 at ice-9/boot-9.scm:109:6 (thrown-k . args)>
syntax-error ...]
In unknown file:
   ?: 0 [catch-closure syntax-error macroexpand ...]

ERROR: In procedure macroexpand:
ERROR: source expression failed to match any pattern in (if val 0 1 2)





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31234>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [bug #31234] [1.9.12] errors in macroexpand don't give line numbers of source
  2010-10-03 18:08 [bug #31234] [1.9.12] errors in macroexpand don't give line numbers of source Mike Gran
@ 2010-11-16  1:57 ` Andy Wingo
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2010-11-16  1:57 UTC (permalink / raw)
  To: Andy Wingo, Mike Gran, bug-guile


Update of bug #31234 (project guile):

                  Status:                    None => Fixed                  
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

I think I have fixed the most egregious nastiness here. Currently loading
your test file gives me:


$ meta/guile /tmp/foo.scm
;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-autocompile argument to disable.
;;; compiling /tmp/foo.scm
;;; WARNING: compilation of /tmp/foo.scm failed:
;;; key syntax-error, throw_args (#f "source expression failed to match any
pattern" ((line . 2) (column . 4) (filename . "/tmp/foo.scm")) (if val 0 1 2)
#f)
Syntax error:
/tmp/foo.scm:2:4: source expression failed to match any pattern in form (if
val 0 1 2)

So all that ;;; WARNING foo is pretty nasty still, but it's better than it
was... If something is missing, open another bug :)

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31234>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-16  1:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-03 18:08 [bug #31234] [1.9.12] errors in macroexpand don't give line numbers of source Mike Gran
2010-11-16  1:57 ` Andy Wingo

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).