Add more AST lowerings for trivial kinds
This includes AST lowering for DebuggerStatements and ConditionalExpressions, both of which are straightforward boilerplate mappings.
This commit is contained in:
parent
e8e031f97c
commit
ca124ea3a6
1 changed files with 12 additions and 3 deletions
|
@ -392,7 +392,11 @@ function transformBlock(node: ts.Block): ast.Block {
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformDebuggerStatement(node: ts.DebuggerStatement): ast.Statement {
|
function transformDebuggerStatement(node: ts.DebuggerStatement): ast.Statement {
|
||||||
return contract.failf("NYI");
|
// The debugger statement in ECMAScript can be used to trip a breakpoint. We don't have the equivalent in Mu at
|
||||||
|
// the moment, so we simply produce an empty statement in its place.
|
||||||
|
return copyLocation(node, {
|
||||||
|
kind: ast.emptyStatementKind,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformEmptyStatement(node: ts.EmptyStatement): ast.EmptyStatement {
|
function transformEmptyStatement(node: ts.EmptyStatement): ast.EmptyStatement {
|
||||||
|
@ -537,8 +541,13 @@ function transformClassExpression(node: ts.ClassExpression): ast.Expression {
|
||||||
return contract.failf("NYI");
|
return contract.failf("NYI");
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformConditionalExpression(node: ts.ConditionalExpression): ast.Expression {
|
function transformConditionalExpression(node: ts.ConditionalExpression): ast.ConditionalExpression {
|
||||||
return contract.failf("NYI");
|
return copyLocation(node, {
|
||||||
|
kind: ast.conditionalExpressionKind,
|
||||||
|
condition: transformExpression(node.condition),
|
||||||
|
consequent: transformExpression(node.whenTrue),
|
||||||
|
alternate: transformExpression(node.whenFalse),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformDeleteExpression(node: ts.DeleteExpression): ast.Expression {
|
function transformDeleteExpression(node: ts.DeleteExpression): ast.Expression {
|
||||||
|
|
Loading…
Reference in a new issue