[honu] return currently parsed form if a macro is seen

This commit is contained in:
Jon Rafkind 2011-09-14 16:07:18 -06:00
parent 18b18aaded
commit 0b4e630b8c
2 changed files with 15 additions and 15 deletions

View File

@ -187,17 +187,19 @@
[(head rest ...)
(cond
[(honu-macro? #'head)
(begin
(debug "Honu macro ~a\n" #'head)
(let-values ([(parsed unparsed terminate?)
((syntax-local-value #'head) #'(head rest ...) #f)])
(with-syntax ([parsed parsed]
[rest unparsed])
(if terminate?
(values (left #'parsed)
#'rest)
(do-parse #'rest precedence
left #'parsed)))))]
(if current
(values (left current) stream)
(begin
(debug "Honu macro ~a\n" #'head)
(let-values ([(parsed unparsed terminate?)
((syntax-local-value #'head) #'(head rest ...) #f)])
(with-syntax ([parsed parsed]
[rest unparsed])
(if terminate?
(values (left #'parsed)
#'rest)
(do-parse #'rest precedence
left #'parsed))))))]
[(parsed-syntax? #'head)
(do-parse #'(rest ...) precedence left #'head)]
[(honu-operator? #'head)

View File

@ -53,10 +53,8 @@ for add in addresses do {
printf("name ~a address ~a\n", add.name, add.address);
}
printf("+++\n");
for xs in linq from foo in xml.Descendants("Table1")
where starts_with("x", foo.Element("familyName").Value())
select foo.Element("familyName").Value() do {
where starts_with("x", foo.Element("familyName").Value())
select foo.Element("familyName").Value() do {
printf("only x: ~a\n", xs)
}
// printf("---\n");