Please sign in to comment.
Really fix handling of ::keywords using aliases
With this patch, Marginalia installs a custom keyword reader during parsing. This reader reuses clojure.lang.LispReader's readToken and matchSymbol methods to read in either the whole keyword (when faced with a single-colon keyword) or the part following the first colon (a single-colon keyword, if we get to this case). Single-colon keywords may have arbitrary namespace parts, so no aliasing issues arise. The object returned depends on the type of keyword being read in: * :foo, :foo/bar => just the keyword * ::foo/bar => (DoubleColonKeyword. :foo/bar) DCK's print-method writes out a single colon followed by the string representation of the DCK's contents, for the genuine double-colon keyword look. Note that readToken and matchSymbol are private; this patch uses clojure.contrib.reflect/call-method to call them.
- Loading branch information...
Showing with 34 additions and 2 deletions.