lookout.core.bytes_to_unicode_converter

Module Contents

class lookout.core.bytes_to_unicode_converter.BytesToUnicodeConverter(content:bytes)

Utility class to convert bytes positions to unicode positions in bblfsh.Node.

convert_content(self)

Convert byte content (or code) to unicode.

convert_uast(self, uast:bblfsh.Node)

Convert uast Nodes bytes position to unicode position.

UAST is expected to correspond to provided content. :param uast: corresponding UAST. :return: UAST with unicode positions.

static convert_file(file:File)

Convert lookout File to UnicodeFile with converted content and uast.

path and language fields are the same for result and provided File instance.

Parameters:file – lookout File to convert.
Returns:New UnicodeFile instance.
static convert_change(change:Change)

Convert lookout Change to UnicodeChange with converted content and uast.

Parameters:change – lookout Change to convert.
Returns:New UnicodeChange instance.