1/* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16import { 17 global, 18 passNode, 19 passNodeArray, 20 unpackNonNullableNode, 21 unpackNode, 22 unpackNodeArray, 23 assertValidPeer, 24 AstNode, 25 Es2pandaAstNodeType, 26 KNativePointer, 27 nodeByType, 28 ArktsObject, 29 unpackString 30} from "../../reexport-for-generated" 31 32import { Expression } from "./Expression" 33import { Es2pandaTokenType } from "./../Es2pandaEnums" 34export class AssignmentExpression extends Expression { 35 constructor(pointer: KNativePointer) { 36 super(pointer) 37 38 } 39 get left(): Expression | undefined { 40 return unpackNode(global.generatedEs2panda._AssignmentExpressionLeftConst(global.context, this.peer)) 41 } 42 get right(): Expression | undefined { 43 return unpackNode(global.generatedEs2panda._AssignmentExpressionRightConst(global.context, this.peer)) 44 } 45 /** @deprecated */ 46 setRight(expr: Expression): this { 47 global.generatedEs2panda._AssignmentExpressionSetRight(global.context, this.peer, passNode(expr)) 48 return this 49 } 50 /** @deprecated */ 51 setLeft(expr: Expression): this { 52 global.generatedEs2panda._AssignmentExpressionSetLeft(global.context, this.peer, passNode(expr)) 53 return this 54 } 55 get result(): Expression | undefined { 56 return unpackNode(global.generatedEs2panda._AssignmentExpressionResultConst(global.context, this.peer)) 57 } 58 get operatorType(): Es2pandaTokenType { 59 return global.generatedEs2panda._AssignmentExpressionOperatorTypeConst(global.context, this.peer) 60 } 61 /** @deprecated */ 62 setResult(expr: Expression): this { 63 global.generatedEs2panda._AssignmentExpressionSetResult(global.context, this.peer, passNode(expr)) 64 return this 65 } 66 get isLogicalExtended(): boolean { 67 return global.generatedEs2panda._AssignmentExpressionIsLogicalExtendedConst(global.context, this.peer) 68 } 69 /** @deprecated */ 70 setIgnoreConstAssign(): this { 71 global.generatedEs2panda._AssignmentExpressionSetIgnoreConstAssign(global.context, this.peer) 72 return this 73 } 74 get isIgnoreConstAssign(): boolean { 75 return global.generatedEs2panda._AssignmentExpressionIsIgnoreConstAssignConst(global.context, this.peer) 76 } 77} 78export function isAssignmentExpression(node: AstNode): node is AssignmentExpression { 79 return node instanceof AssignmentExpression 80}