On Sat, May 24, 2014 at 3:09 PM, Gregg Reynolds <d...@mobileink.com> wrote:

> Hi,
>
> In working on an ANTLR grammar for Clojure I came across this regex in
> clojure.lang.LispReader which is used in matchSymbol:
>
> symbolPat == [:]?([\\D&&[^/]].*/)?(/|[\\D&&[^/]][^/]*)
>
> Look at the first part of the second group:
>
> /|[\\D&&[^/]]
>
> Am I missing something or is that equal to \\D?
>

That would be equal to \\D, but you're missing that /|[\\D&&[^/]][^/]* is
the alternation of / and [\\D&&[^/]][^/]* rather than ( the alternation of
/ and [\\D&&[^/]] ) concatenated with [^/]*

'/' is special-cased as a symbol.  It can only be used (with an optional
namespace) if it's the only character in the name.

Best,
Ben

-- 
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/d/optout.

Reply via email to