Re: instaparse question

2013-10-31 Thread Jim - FooBar();
On 31/10/13 17:21, Lars Nilsson wrote: Perhaps remove DRUG from the grammar and use the transform function on a parse-result to do something like (insta/transform {:WORD (fn [w] (if (...) [:DRUG w] [:WORD w]))} parse-result) so [:DRUG w] is emitted for whatever criteria you may have (lookup) wh

Re: instaparse question

2013-10-31 Thread Lars Nilsson
On Thu, Oct 31, 2013 at 12:47 PM, Jim - FooBar(); wrote: > On 31/10/13 16:23, Jim - FooBar(); wrote: >> >> The result of this is a parser which sees everyhting as :TOKEN. That is >> because WORD matches almost everything. However I thought that putting it >> last would remedy the situation...it se

Re: instaparse question

2013-10-31 Thread Jim - FooBar();
On 31/10/13 16:23, Jim - FooBar(); wrote: The result of this is a parser which sees everyhting as :TOKEN. That is because WORD matches almost everything. However I thought that putting it last would remedy the situation...it seems that the most general rule is applied first. Is that by design?A

instaparse question

2013-10-31 Thread Jim - FooBar();
Hi all, I'm starting to get the hang of instaparse and it just looks awesome! However there is a little thing that bugs meI may be doing it wrong that why I'm asking here. The behaviour that I want sounds reasonable at least to me...so here is an example: (insta/parser "S = TOKEN (SP