Skip to content

Commit fe568ff

Browse files
committed
Placeholders for unary/throw/record kinds
1 parent f48a843 commit fe568ff

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

Expression.pq

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let
22
// Entry point for routing the calls for various AST node "Kind"s
3+
// TODO: record
34
// TODO: unary
45
// TODO: throw
56
handleExp = (x) =>
@@ -12,9 +13,30 @@ let
1213
if (kind = "FieldAccess") then fieldAccessExp(x) else
1314
if (kind = "Identifier") then identifierExp(x) else
1415
if (kind = "Constant") then constantExp(x) else
16+
if (kind = "Record") then recordExp(x) else
17+
if (kind = "Unary") then unaryExp(x) else
18+
if (kind = "Throw") then throwExp(x) else
1519
Text.Format("Unkonw Kind: #{0}",{kind})
1620
in
1721
expr,
22+
23+
recordExp = (x) =>
24+
let
25+
z = ...
26+
in
27+
z,
28+
29+
unaryExp = (x) =>
30+
let
31+
z = ...
32+
in
33+
z,
34+
35+
throwExp = (x) =>
36+
let
37+
z = ...
38+
in
39+
z,
1840

1941
// "Invocation" node handling
2042
invocationExp = (x) =>
@@ -103,7 +125,10 @@ let
103125
// Function to decompile
104126
fn = List.Range,
105127
// Getting a "shalow" view on the AST
106-
AST = Value.ResourceExpression(fn)[Expression][Arguments]{0}[Function][Expression][Expression],
128+
// TODO: replace with a search
129+
AST =
130+
try Value.ResourceExpression(fn)[Expression][Function][Expression] otherwise
131+
Value.ResourceExpression(fn)[Expression][Arguments]{0}[Function][Expression][Expression],
107132
// Start
108133
expression = run(AST)
109134
in

0 commit comments

Comments
 (0)