Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit e66ec8c

Browse files
authored
Merge pull request #81 from juanjux/feature/position_iterator
Binding for position iterator + tests + update to grpcio 1.10.0
2 parents 822329f + 22f5ddf commit e66ec8c

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

bblfsh/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
from bblfsh.aliases import *
44

55
class TreeOrder:
6-
PRE_ORDER = 0
7-
POST_ORDER = 1
8-
LEVEL_ORDER = 2
6+
PRE_ORDER = 0
7+
POST_ORDER = 1
8+
LEVEL_ORDER = 2
9+
POSITION_ORDER = 3
910

1011
# "in" is a reserved keyword in Python thus can't be used as package name, so
1112
# we import by string

bblfsh/test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@ def testIteratorLevelOrder(self):
210210
self.assertListEqual(expanded, ['root', 'son1', 'son2', 'son1_1',
211211
'son1_2', 'son2_1', 'son2_2'])
212212

213+
def testIteratorPositionOrder(self):
214+
root = self._itTestTree()
215+
it = iterator(root, TreeOrder.POSITION_ORDER)
216+
self.assertIsNotNone(it)
217+
expanded = [node.internal_type for node in it]
218+
self.assertListEqual(expanded, ['root', 'son1', 'son2_1', 'son1_2',
219+
'son1_1', 'son2_2', 'son2'])
220+
213221
def _validate_resp(self, resp):
214222
self.assertIsNotNone(resp)
215223
self.assertEqual(type(resp).DESCRIPTOR.full_name,

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
from setuptools import setup, find_packages, Extension
66
from setuptools.command.build_ext import build_ext
77

8-
VERSION = "2.9.4"
9-
LIBUAST_VERSION = "v1.8.2"
8+
VERSION = "2.9.5"
9+
LIBUAST_VERSION = "v1.9.0"
1010
SDK_VERSION = "v1.8.0"
1111
SDK_MAJOR = SDK_VERSION.split('.')[0]
1212
PYTHON = "python3"
@@ -144,7 +144,7 @@ def main():
144144
packages=find_packages(),
145145
exclude=["bblfsh/test.py"],
146146
keywords=["babelfish", "uast"],
147-
install_requires=["grpcio==1.9.1", "grpcio-tools==1.9.1", "docker", "protobuf>=3.4.0"],
147+
install_requires=["grpcio==1.10.0", "grpcio-tools==1.10.0", "docker", "protobuf>=3.4.0"],
148148
package_data={"": ["LICENSE", "README.md"]},
149149
ext_modules=[libuast_module],
150150
classifiers=[
@@ -161,5 +161,6 @@ def main():
161161
]
162162
)
163163

164+
164165
if __name__ == '__main__':
165166
main()

0 commit comments

Comments
 (0)