* psyntax error reporting bug
@ 2009-10-18 20:58 Julian Graham
2009-10-18 21:41 ` Ludovic Courtès
0 siblings, 1 reply; 5+ messages in thread
From: Julian Graham @ 2009-10-18 20:58 UTC (permalink / raw)
To: guile-devel
Hi Guilers,
I'm no psyntax expert, but it looks like there's a minor typo in our
psyntax implementation. In psyntax.scm, at line 1325 (in
`chi-macro'), the expression:
(syntax-violation #f "encountered raw symbol in macro output"
(source-wrap e w s mod) x)
...should read:
(syntax-violation #f "encountered raw symbol in macro output"
(source-wrap e w (wrap-subst w) mod) x)
...since `s' is not actually in scope -- which, with the former code,
generates an error that obscures the actual syntax violation. I can
prepare a patch if people want.
Regards,
Julian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: psyntax error reporting bug
2009-10-18 20:58 psyntax error reporting bug Julian Graham
@ 2009-10-18 21:41 ` Ludovic Courtès
2009-10-18 22:05 ` Julian Graham
0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2009-10-18 21:41 UTC (permalink / raw)
To: guile-devel
Hello!
Julian Graham <joolean@gmail.com> writes:
> I'm no psyntax expert, but it looks like there's a minor typo in our
> psyntax implementation. In psyntax.scm, at line 1325 (in
> `chi-macro'), the expression:
>
> (syntax-violation #f "encountered raw symbol in macro output"
> (source-wrap e w s mod) x)
>
> ...should read:
>
> (syntax-violation #f "encountered raw symbol in macro output"
> (source-wrap e w (wrap-subst w) mod) x)
>
> ...since `s' is not actually in scope
I actually noticed that when testing ‘-Wunbound-variable’:
ice-9/psyntax-pp.scm:1089:38: warning: possibly unbound variable `s'
But I didn’t take the time to investigate, so I’m glad you did. :-)
> -- which, with the former code, generates an error that obscures the
> actual syntax violation. I can prepare a patch if people want.
Andy is the expert, but I think such a patch can’t hurt, so please do!
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: psyntax error reporting bug
2009-10-18 21:41 ` Ludovic Courtès
@ 2009-10-18 22:05 ` Julian Graham
2009-10-19 19:25 ` Andy Wingo
2009-10-19 20:46 ` Ludovic Courtès
0 siblings, 2 replies; 5+ messages in thread
From: Julian Graham @ 2009-10-18 22:05 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guile-devel
[-- Attachment #1: Type: text/plain, Size: 132 bytes --]
Hi Ludo,
> Andy is the expert, but I think such a patch can’t hurt, so please do!
Done! See attached.
Regards,
Julian
[-- Attachment #2: 0001-Fix-typo-in-psyntax.scm-related-to-syntax-violation.patch --]
[-- Type: text/x-diff, Size: 1011 bytes --]
From 48128b32d7f9d9613e46b61a3c695d786152fb67 Mon Sep 17 00:00:00 2001
From: Julian Graham <julian.graham@aya.yale.edu>
Date: Sun, 18 Oct 2009 17:56:13 -0400
Subject: [PATCH] Fix typo in psyntax.scm related to syntax-violation reporting.
* module/ice-9/psyntax.scm (chi-macro): Replace `s' with `(wrap-subst w)'.
---
module/ice-9/psyntax.scm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/module/ice-9/psyntax.scm b/module/ice-9/psyntax.scm
index cb90fcc..1b5addd 100644
--- a/module/ice-9/psyntax.scm
+++ b/module/ice-9/psyntax.scm
@@ -1323,7 +1323,7 @@
(rebuild-macro-output (vector-ref x i) m)))))
((symbol? x)
(syntax-violation #f "encountered raw symbol in macro output"
- (source-wrap e w s mod) x))
+ (source-wrap e w (wrap-subst w) mod) x))
(else x))))
(rebuild-macro-output (p (wrap e (anti-mark w) mod)) (new-mark))))
--
1.6.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: psyntax error reporting bug
2009-10-18 22:05 ` Julian Graham
@ 2009-10-19 19:25 ` Andy Wingo
2009-10-19 20:46 ` Ludovic Courtès
1 sibling, 0 replies; 5+ messages in thread
From: Andy Wingo @ 2009-10-19 19:25 UTC (permalink / raw)
To: Julian Graham; +Cc: Ludovic Courtès, guile-devel
Hi Julian,
On Mon 19 Oct 2009 00:05, Julian Graham <joolean@gmail.com> writes:
> Done! See attached.
Looks right to me, please commit :-)
Andy
> From 48128b32d7f9d9613e46b61a3c695d786152fb67 Mon Sep 17 00:00:00 2001
> From: Julian Graham <julian.graham@aya.yale.edu>
> Date: Sun, 18 Oct 2009 17:56:13 -0400
> Subject: [PATCH] Fix typo in psyntax.scm related to syntax-violation reporting.
>
> * module/ice-9/psyntax.scm (chi-macro): Replace `s' with `(wrap-subst w)'.
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: psyntax error reporting bug
2009-10-18 22:05 ` Julian Graham
2009-10-19 19:25 ` Andy Wingo
@ 2009-10-19 20:46 ` Ludovic Courtès
1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2009-10-19 20:46 UTC (permalink / raw)
To: guile-devel
Applied, thanks!
Ludo'.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-19 20:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-18 20:58 psyntax error reporting bug Julian Graham
2009-10-18 21:41 ` Ludovic Courtès
2009-10-18 22:05 ` Julian Graham
2009-10-19 19:25 ` Andy Wingo
2009-10-19 20:46 ` Ludovic Courtès
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).