exceptions
¶
Module for Exceptions.
Classes:
-
CatchHandlerStmt
–AST class for catch statements.
-
ExceptionHandlerStmt
–AST class for try statements.
-
FinallyHandlerStmt
–AST class for finally statements.
-
ThrowStmt
–AST class for throw statements.
CatchHandlerStmt
¶
CatchHandlerStmt(body: Block[AST], name: Optional[Identifier] = None, types: Optional[Iterable[Identifier] | ASTNodes[Identifier]] = None, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: StatementType
AST class for catch statements.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/exceptions.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/exceptions.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|
ExceptionHandlerStmt
¶
ExceptionHandlerStmt(body: Block[AST], handlers: Iterable[CatchHandlerStmt] | ASTNodes[CatchHandlerStmt], finally_handler: Optional[FinallyHandlerStmt] = None, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: StatementType
AST class for try statements.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/exceptions.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/exceptions.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|
FinallyHandlerStmt
¶
FinallyHandlerStmt(body: Block[AST], parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: StatementType
AST class for finally statements.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/exceptions.py
177 178 179 180 181 182 183 184 185 186 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/exceptions.py
192 193 194 195 196 197 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|
ThrowStmt
¶
ThrowStmt(exception: Optional[Expr] = None, parent: Optional[ASTNodes] = None, loc: SourceLocation = NO_SOURCE_LOCATION)
Bases: StatementType
AST class for throw statements.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/exceptions.py
32 33 34 35 36 37 38 39 40 41 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/exceptions.py
50 51 52 53 54 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|