bugGuile - Bugs: bug #31234, [1.9.12] errors in macroexpand...

 
 

bug #31234: [1.9.12] errors in macroexpand don't give line numbers of source

Submitter:  Mike Gran <mike121>
Submitted:  Sun 03 Oct 2010 06:08:46 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 16 Nov 2010 01:57:56 AM UTC, 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 :)

Andy Wingo <wingo>
Group administrator
Sun 03 Oct 2010 06:08:46 PM UTC, original submission:  

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)

Mike Gran <mike121>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wingo (Posted a comment)
  • -email is unavailable- added by mike121 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-11-16 wingo StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code