bblfsh / python-driver

GNU General Public License v3.0
10 stars 16 forks source link

Handle NaN and Infinity values properly #190

Closed dennwc closed 5 years ago

dennwc commented 5 years ago

JSON has no way to represent NaN and Infinity values, but the native driver currently encodes them as raw text (Infinity) breaking the native protocol.

This change checks all Num literals and replaces Infinity values with the corresponding Python string representation ("inf").

Fixes #182

Signed-off-by: Denys Smirnov denys@sourced.tech