fork of hey-api/openapi-ts because I need some additional things
at feat/skip-token 26 lines 749 B view raw
1import type { PyNodeBase } from '../base'; 2import type { PyExpression } from '../expression'; 3import type { PyIdentifier } from '../expressions/identifier'; 4import { PyNodeKind } from '../kinds'; 5import type { PyStatement } from '../statement'; 6import { createBlock, type PyBlock } from './block'; 7 8export interface PyExceptClause extends PyNodeBase { 9 block: PyBlock; 10 exceptionName?: PyIdentifier; 11 exceptionType?: PyExpression; 12 kind: PyNodeKind.ExceptClause; 13} 14 15export function createExceptClause( 16 block: ReadonlyArray<PyStatement>, 17 exceptionType?: PyExpression, 18 exceptionName?: PyIdentifier, 19): PyExceptClause { 20 return { 21 block: createBlock(block), 22 exceptionName, 23 exceptionType, 24 kind: PyNodeKind.ExceptClause, 25 }; 26}