// Copyright (c) The Move Contributors // SPDX-License-Identifier: Apache-2.0 import { Node } from '../..'; import { MoveOptions, printFn, treeFn } from '../../printer'; import { AstPath, Doc, doc } from 'prettier'; const {} = doc.builders; /** The type of the node implemented in this file */ export const NODE_TYPE = 'continue_expression'; export default function (path: AstPath): treeFn | null { if (path.node.type === NODE_TYPE) { return printContinueExpression; } return null; } /** * Print `continue_expression` node. */ function printContinueExpression(path: AstPath, options: MoveOptions, print: printFn): Doc { if (path.node.nonFormattingChildren.length === 1) { return ['continue ', path.call(print, 'nonFormattingChildren', 0)]; } return 'continue'; }