-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.txt
72 lines (66 loc) · 4.15 KB
/
test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
%% -*- erlang -*-
show_parse_tree.
[
% simple
{<<>>, 'empty'},
{<<"Aaab1234">>, <<"Aaab1234">>},
{<<"x.a[]">>, {'[]',<<"x.a">>,[]}},
{<<"a{}">>, {'{}',<<"a">>,[]}},
{<<"a{}[]">>, {'[]',{'{}',<<"a">>,[]},[]}},
{<<"a[1,2,3]">>, {'[]',<<"a">>,[1,2,3]}},
{<<"a{x,y,z}">>, {'{}',<<"a">>,[<<"x">>,<<"y">>,<<"z">>]}},
{<<"h.a:b[ ]">>, {'[]',{':',<<"b">>,<<"h.a">>},[]}},
{<<"a:b[]:c">>, {':',<<"c">>,{'[]',{':',<<"b">>,<<"a">>},[]}}},
{<<"a:b[1]:c">>, {':',<<"c">>,{'[]',{':',<<"b">>,<<"a">>},[1]}}},
{<<"a:b\n[1, 2,3]">>, {'[]',{':',<<"b">>,<<"a">>},[1,2,3]}},
{<<"a:b.g{}">>, {'{}',{':',<<"b.g">>,<<"a">>},[]}},
{<<"a:b{x}">>, {'{}',{':',<<"b">>,<<"a">>},[<<"x">>]}},
{<<"a:b {x\t,y\r,z}">>, {'{}',{':',<<"b">>,<<"a">>},[<<"x">>,<<"y">>,<<"z">>]}},
{<<"a:b{}:c">>, {':',<<"c">>,{'{}',{':',<<"b">>,<<"a">>},[]}}},
{<<"a:b{x\n}:c">>, {':',<<"c">>,{'{}',{':',<<"b">>,<<"a">>},[<<"x">>]}}},
{<<"a[]{}:b{}[]">>, {'[]',{'{}',{':',<<"b">>,{'{}',{'[]',<<"a">>,[]},[]}},[]},[]}},
% simple nested functions
{<<"a[f()]">>, {'[]',<<"a">>,[{'fun',<<"f">>,[]}]}},
{<<"a[f(x,y)]">>, {'[]',<<"a">>,[{'fun',<<"f">>,[<<"x">>,<<"y">>]}]}},
{<<"a{f()}">>, {'{}',<<"a">>,[{'fun',<<"f">>,[]}]}},
{<<"a{f(x,y)}">>, {'{}',<<"a">>,[{'fun',<<"f">>,[<<"x">>,<<"y">>]}]}},
{<<"a{}[f()]">>, {'[]',{'{}',<<"a">>,[]},[{'fun',<<"f">>,[]}]}},
{<<"a{f()}[]">>, {'[]',{'{}',<<"a">>,[{'fun',<<"f">>,[]}]},[]}},
{<<"a{f()}[f()]">>, {'[]',{'{}',<<"a">>,[{'fun',<<"f">>,[]}]},[{'fun',<<"f">>,[]}]}},
{<<"a{f(x)}[f(y)]">>, {'[]',{'{}',<<"a">>,[{'fun',<<"f">>,[<<"x">>]}]},[{'fun',<<"f">>,[<<"y">>]}]}},
{<<"a:b[f()]:c">>, {':',<<"c">>,{'[]',{':',<<"b">>,<<"a">>},[{'fun',<<"f">>,[]}]}}},
{<<"a:b{f()}:c">>, {':',<<"c">>,{'{}',{':',<<"b">>,<<"a">>},[{'fun',<<"f">>,[]}]}}},
{<<"a:f():c">>, {':',<<"c">>,{':',{'fun',<<"f">>,[]},<<"a">>}}},
{<<"a:f(x,y):c">>, {':',<<"c">>,{':',{'fun',<<"f">>,[<<"x">>,<<"y">>]},<<"a">>}}},
{<<"a:f(y(p,q)):c">>, {':',<<"c">>,{':',{'fun',<<"f">>,[{'fun',<<"y">>,[<<"p">>,<<"q">>]}]},<<"a">>}}},
{<<"a:f(y(p,q),x):c">>, {':',<<"c">>,{':',{'fun',<<"f">>,[{'fun',<<"y">>,[<<"p">>,<<"q">>]},<<"x">>]}
,<<"a">>}}},
{<<"a:f(x,y(p,q)):c">>, {':',<<"c">>,{':',{'fun',<<"f">>,[<<"x">>,{'fun',<<"y">>,[<<"p">>,<<"q">>]}]}
,<<"a">>}}},
% # operator
{<<"a#keys">>, {'#',<<"keys">>,<<"a">>}},
{<<"a:b#keys">>, {'#',<<"keys">>,{':',<<"b">>,<<"a">>}}},
{<<"a#values:b">>, {':',<<"b">>,{'#',<<"values">>,<<"a">>}}},
{<<"a[b#keys]">>, {'[]',<<"a">>,[{'#',<<"keys">>,<<"b">>}]}},
{<<"a:b{a#keys}">>, {'{}',{':',<<"b">>,<<"a">>},[{'#',<<"keys">>,<<"a">>}]}},
{<<"a:b{a#keys}[1,2]">>, {'[]',{'{}',{':',<<"b">>,<<"a">>},[{'#',<<"keys">>,<<"a">>}]},[1,2]}},
% :: operator
{<<"a::b">>, {'::',<<"b">>,<<"a">>}},
{<<"a::b::c">>, {'::',<<"c">>,{'::',<<"b">>,<<"a">>}}},
{<<"a:b::c">>, {'::',<<"c">>,{':',<<"b">>,<<"a">>}}},
{<<"a::b:c">>, {':',<<"c">>,{'::',<<"b">>,<<"a">>}}},
{<<"a{b}::c">>, {'::',<<"c">>,{'{}',<<"a">>,[<<"b">>]}}},
{<<"a{b,c}::d">>, {'::',<<"d">>,{'{}',<<"a">>,[<<"b">>,<<"c">>]}}},
% path within
{<<"a:b[x:y]:c">>, {':',<<"c">>,{'[]',{':',<<"b">>,<<"a">>},[{':',<<"y">>,<<"x">>}]}}},
{<<"a:b[]{f(x:y)}:c">>, {':',<<"c">>,{'{}',{'[]',{':',<<"b">>,<<"a">>},[]}
,[{'fun',<<"f">>,[{':',<<"y">>,<<"x">>}]}]}}},
% # variations of column names
{<<"a_@$#keys">>, {'#',<<"keys">>,<<"a_@$">>}},
{<<"a.b#keys">>, {'#',<<"keys">>,<<"a.b">>}},
{<<"a.\"b\"#keys">>, {'#',<<"keys">>,<<"a.\"b\"">>}},
{<<"a.b.c#keys">>, {'#',<<"keys">>,<<"a.b.c">>}},
{<<"\"a_#\"#keys">>, {'#',<<"keys">>,<<"\"a_#\"">>}},
{<<"\"a\".\"b\"#keys">>, {'#',<<"keys">>,<<"\"a\".\"b\"">>}},
{<<"\"a\".b#keys">>, {'#',<<"keys">>,<<"\"a\".b">>}}
].