Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bblfsh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from bblfsh.aliases import *

class TreeOrder:
PRE_ORDER = 0
POST_ORDER = 1
LEVEL_ORDER = 2
PRE_ORDER = 0
POST_ORDER = 1
LEVEL_ORDER = 2
POSITION_ORDER = 3

# "in" is a reserved keyword in Python thus can't be used as package name, so
# we import by string
Expand Down
8 changes: 8 additions & 0 deletions bblfsh/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ def testIteratorLevelOrder(self):
self.assertListEqual(expanded, ['root', 'son1', 'son2', 'son1_1',
'son1_2', 'son2_1', 'son2_2'])

def testIteratorPositionOrder(self):
root = self._itTestTree()
it = iterator(root, TreeOrder.POSITION_ORDER)
self.assertIsNotNone(it)
expanded = [node.internal_type for node in it]
self.assertListEqual(expanded, ['root', 'son1', 'son2_1', 'son1_2',
'son1_1', 'son2_2', 'son2'])

def _validate_resp(self, resp):
self.assertIsNotNone(resp)
self.assertEqual(type(resp).DESCRIPTOR.full_name,
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext

VERSION = "2.9.4"
LIBUAST_VERSION = "v1.8.2"
VERSION = "2.9.5"
LIBUAST_VERSION = "v1.9.0"
SDK_VERSION = "v1.8.0"
SDK_MAJOR = SDK_VERSION.split('.')[0]
PYTHON = "python3"
Expand Down Expand Up @@ -144,7 +144,7 @@ def main():
packages=find_packages(),
exclude=["bblfsh/test.py"],
keywords=["babelfish", "uast"],
install_requires=["grpcio==1.9.1", "grpcio-tools==1.9.1", "docker", "protobuf>=3.4.0"],
install_requires=["grpcio==1.10.0", "grpcio-tools==1.10.0", "docker", "protobuf>=3.4.0"],
package_data={"": ["LICENSE", "README.md"]},
ext_modules=[libuast_module],
classifiers=[
Expand All @@ -161,5 +161,6 @@ def main():
]
)


if __name__ == '__main__':
main()