-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
While trying the LFE example out I couldn't get the generated parser code to be different from the include/spell1inc.lfe template. I tracked the problem down to the patterns used in this case:
(case line
(`(,@"##module" . ,_) (output-module out st))
(`(,@"##code" . ,_) (output-user-code out st))
(`(,@"##entry" . ,_) (output-entry out st))
(`(,@"##table" . ,_) (output-table out st))
(`(,@"##reduce" . ,_) (output-reduce out st))
(_ (io:put_chars out line)))I tried a similar approach in the shell and I got the following result:
> (set `(,@"hello" . ,_) "hello!")
1: Warning: deprecated pattern
1: Warning: deprecated pattern
exception error: #(badmatch "hello!")If I change the patterns to the actual contents of the line (with the newline char and all) then everything the generated code gets inserted as expected:
(case line
("##module\n" (output-module out st))
("##code\n" (output-user-code out st))
("##entry\n" (output-entry out st))
("##table\n" (output-table out st))
("##reduce" (output-reduce out st))
(_ (io:put_chars out line)))I might be doing something really wrong though.