Hi,

The attempt parser does not work as expected for me. Perhaps my 
understanding is not correct. I the following code I was hoping that 
parsatron would attempt to parser "hello" and fail. Resulting no 
consumption of input due to "attempt". However, when I run this code, the 
parser fails saying  Unexpected token 'w' 

(ns myparser.core
  (:require [the.parsatron :as p]))

(p/defparser helloParser []
  (p/string "hello"))
(p/defparser worldParser []
  (p/string "world"))


(p/defparser p []
  (p/let->> [
             h (p/attempt (helloParser))
             w (worldParser)
             ]
            (p/always [h w])))
            
(println (p/run (p) "world"))


Regards,
Kashyap

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to