Skip to content

Commit d8e230a

Browse files
authored
Adding flatfile.HierarchyReader which is closely modeled after edi.reader but with more abstraction with the use of RecReader. (#165)
And more thorough unit level tests (compared with more end-to-end-ish tests in edi.reader) For comparison, edi.reader: https://github.com/jf-tech/omniparser/blob/927d69a1960aa8268a4e5eb828c605abd013f36c/extensions/omniv21/fileformat/edi/reader.go
1 parent 927d69a commit d8e230a

7 files changed

+924
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"Stack": [
3+
{
4+
"RecDecl": "#root",
5+
"RecNode": "#root",
6+
"CurChild": 0,
7+
"Occurred": 0
8+
},
9+
{
10+
"RecDecl": "A",
11+
"RecNode": "A",
12+
"CurChild": 1,
13+
"Occurred": 0
14+
},
15+
{
16+
"RecDecl": "C",
17+
"RecNode": null,
18+
"CurChild": 0,
19+
"Occurred": 0
20+
}
21+
],
22+
"Target": null
23+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"Stack": [
3+
{
4+
"RecDecl": "#root",
5+
"RecNode": "#root",
6+
"CurChild": 0,
7+
"Occurred": 0
8+
},
9+
{
10+
"RecDecl": "A",
11+
"RecNode": "A",
12+
"CurChild": 0,
13+
"Occurred": 1
14+
}
15+
],
16+
"Target": "A"
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"Stack": [
3+
{
4+
"RecDecl": "#root",
5+
"RecNode": "#root",
6+
"CurChild": 0,
7+
"Occurred": 0
8+
},
9+
{
10+
"RecDecl": "A",
11+
"RecNode": null,
12+
"CurChild": 0,
13+
"Occurred": 1
14+
}
15+
],
16+
"Target": null
17+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"Stack": [
3+
{
4+
"RecDecl": "#root",
5+
"RecNode": "#root",
6+
"CurChild": 0,
7+
"Occurred": 0
8+
},
9+
{
10+
"RecDecl": "A",
11+
"RecNode": "A",
12+
"CurChild": 1,
13+
"Occurred": 0
14+
},
15+
{
16+
"RecDecl": "C",
17+
"RecNode": "C",
18+
"CurChild": 0,
19+
"Occurred": 1
20+
}
21+
],
22+
"Target": null
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Stack": [
3+
{
4+
"RecDecl": "#root",
5+
"RecNode": "#root",
6+
"CurChild": 0,
7+
"Occurred": 1
8+
}
9+
],
10+
"Target": null
11+
}

0 commit comments

Comments
 (0)