[honu] return currently parsed form if a macro is seen
This commit is contained in:
parent
18b18aaded
commit
0b4e630b8c
|
@ -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)
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue
Block a user