Skip to content

Commit 7b76d44

Browse files
committed
Implemented array support in FI parsing.
1 parent 79b1c14 commit 7b76d44

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

hkpy/hklib/fi/fiparser.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ def processJsonPlus(ast):
9898

9999

100100
def processArray(ast):
101-
raise Exception('Not supported!')
101+
array = []
102+
if len(ast.children) > 0:
103+
members = ast.children
104+
for member in members:
105+
element = processJsonPlus(member)
106+
array.append(element)
107+
return array
108+
102109

103110
def processObject(ast):
104111
object = {}

tests/test_fi.py

+3
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@
5353
data = repo.resolve_fi(fi)
5454
repo.persist_fi(fi)
5555

56+
57+
# Test parse
58+
fi = FI('file.func(["A", "B"])')

0 commit comments

Comments
 (0)