vy/meta-sexp — Issue #1: Problems with (:assign var #\char)
Author: jjkola
Created: 2012-01-12 10:40:36+00:00
State: open

I was creating a syntax parser and because I haven't yet decided all things I was using dummy values in the syntax code.

So I had the following code:

(defrule test (&aux param) ()
(:or (:and (:icase "t") (:assign param #\t))
(:and (:icase "r") (:assign param #\r)))
(:return param))

When I called (test (create-parser-context "t")) I was baffled that why was the case failing even though it should not have (or at least I thought so).

After I reviewed the generated code I realized (well, I didn't immediately check that as I just tried experimenting with code to see why it was failing) that #\t was being transformed to a check even though what I wanted was to use the value as is. As it was kind of experimental code and I don't think I will use charcters in the production code this is not a problem to me but I thought I will write this down so that if others have same kind of problems they will be able resolve the case quicker.