Skip to content

Releases: bpsm/edn-java

Support Unicode Escapes

02 May 19:15
Compare
Choose a tag to compare
  • Drop support for Java 7 (Require at least Java 8.)
  • 59: Accept \uXXXX style unicode escapes in string literals
  • 60: Support \uXXXX style 16-bit unicode character literals
  • 62: Accept names (of keywords and symbols) which contain #

Drop Java 6 Support

02 May 18:25
Compare
Choose a tag to compare

edn-java 0.6.0 requires at least Java 7.

0.5.0 (namespaced maps; detect duplicate keys)

11 Dec 20:45
Compare
Choose a tag to compare

This release:

#47 Can read namespaced maps as per CLJ-1910

Maps written thus      parse as below
-----------------      --------------
  #:foo {              {
     :a     1,            :foo/a 1,
      b     2,             foo/b 2,
      _/c   3,             c     3,
     :_/d   4,            :d     4,
      bar/e 5,             bar/e 5,
     :bar/f 6             :bar/f 6
  }                    }

Symbols or keywords appearing as keys in the map without a namespace receive as a namespace the symbol following #: preceding the map. In this example that symbol is 'foo'. (see the keys :a and b).

Maps so prefixed would lose the ability to contain keys with no namespace unless they provided some mechanism to opt out of this feature. Within namespaced maps the namespace prefix _ will cause the keyword or symbol to be parsed as being without a namespace. (see the keys /c and :/d)

Symbols or keywords which already have a namespace (other than _ as mentioned above) are parsed as they are just as if the map containing them had not been namespaced.

Compatibility note:

Clients that use Scanner directly should be aware that the enum Token has gained a new value:

Token.DEFAULT_NAMESPACE_FOLLOWS

This is emitted by Scanner when "#:" is parsed. It will be followed by a bare symbol naming the default namespace provided the input being scanned is syntactically correct.

#49 Throws an exception when asked to read a map or set with duplicates

An EdnSyntaxException will be thrown when parsing map or set literals to signal the detection of a duplicate key (in a map) or element (in a set). This is accomplished by teaching CollectionBuilder.add() implementations used by default for Maps and Sets to check for duplicates.

Third-party implementations of CollectionBuilder will probably want to implement this check in their own add method as well.