wake.core.visitor
module
#
Visitor
class
#
Base class for detectors and printers. visit_
methods are called automatically by the execution engine.
Attributes:
Name | Type | Description |
---|---|---|
build |
ProjectBuild
|
The latest compilation build of the project. |
build_info |
ProjectBuildInfo
|
Information about the latest compilation build of the project. |
config |
WakeConfig
|
The loaded Wake configuration. |
imports_graph |
DiGraph
|
A directed graph representing the import dependencies of the project. Nodes are represented by string source unit names. Edges are directed from the imported source unit to the importing source unit. Nodes hold the following data attributes:
Warning Imports graph may contain source units that are not present in the build. This can happen for example because of a failed compilation. |
logger |
Logger
|
A logger instance that can be used to log messages to the console. The log messages are redirected to a VS Code output window in the case of detectors running in the VS Code extension. |
Source code in wake/core/visitor.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 |
|
generate_link(node)
#
Generate a link to the start of the given node based on name_location or byte_location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node
|
IrAbc
|
Node to generate a link to. |
required |
Returns:
Type | Description |
---|---|
str
|
A link formatted according to the link_format configuration option. |
Source code in wake/core/visitor.py
generate_link_from_line_col(path, line, col)
#
Generate a link to the given source unit file location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
Union[str, Path]
|
Path to the source unit file. |
required |
line
|
int
|
Line number. |
required |
col
|
int
|
Column number. |
required |
Returns:
Type | Description |
---|---|
str
|
A link formatted according to the link_format configuration option. |
Source code in wake/core/visitor.py
visit_array_type_name(node)
#
Visit ArrayTypeName node.
visit_assignment(node)
#
Visit Assignment node.
visit_binary_operation(node)
#
Visit BinaryOperation node.
visit_block(node)
#
visit_break(node)
#
visit_conditional(node)
#
Visit Conditional node.
visit_continue(node)
#
visit_contract_definition(node)
#
Visit ContractDefinition node.
visit_declaration_abc(node)
#
Visit any DeclarationAbc node.
visit_do_while_statement(node)
#
Visit DoWhileStatement node.
visit_elementary_type_name(node)
#
Visit ElementaryTypeName node.
visit_elementary_type_name_expression(node)
#
Visit ElementaryTypeNameExpression node.
visit_emit_statement(node)
#
Visit EmitStatement node.
visit_enum_definition(node)
#
Visit EnumDefinition node.
visit_enum_value(node)
#
visit_error_definition(node)
#
Visit ErrorDefinition node.
visit_event_definition(node)
#
Visit EventDefinition node.
visit_expression_abc(node)
#
Visit any ExpressionAbc node.
visit_expression_statement(node)
#
Visit ExpressionStatement node.
visit_for_statement(node)
#
Visit ForStatement node.
visit_function_call(node)
#
Visit FunctionCall node.
visit_function_call_options(node)
#
Visit FunctionCallOptions node.
visit_function_definition(node)
#
Visit FunctionDefinition node.
visit_function_type_name(node)
#
Visit FunctionTypeName node.
visit_identifier(node)
#
Visit Identifier node.
visit_identifier_path(node)
#
Visit IdentifierPath node.
visit_if_statement(node)
#
Visit IfStatement node.
visit_import_directive(node)
#
Visit ImportDirective node.
visit_index_access(node)
#
Visit IndexAccess node.
visit_index_range_access(node)
#
Visit IndexRangeAccess node.
visit_inheritance_specifier(node)
#
Visit InheritanceSpecifier node.
visit_inline_assembly(node)
#
Visit InlineAssembly node.
visit_ir_abc(node)
#
visit_literal(node)
#
visit_mapping(node)
#
visit_member_access(node)
#
Visit MemberAccess node.
visit_modifier_definition(node)
#
Visit ModifierDefinition node.
visit_modifier_invocation(node)
#
Visit ModifierInvocation node.
visit_new_expression(node)
#
Visit NewExpression node.
visit_override_specifier(node)
#
Visit OverrideSpecifier node.
visit_parameter_list(node)
#
Visit ParameterList node.
visit_placeholder_statement(node)
#
Visit PlaceholderStatement node.
visit_pragma_directive(node)
#
Visit PragmaDirective node.
visit_return(node)
#
visit_revert_statement(node)
#
Visit RevertStatement node.
visit_solidity_abc(node)
#
Visit any SolidityAbc node.
visit_source_unit(node)
#
Visit SourceUnit node.
visit_statement_abc(node)
#
Visit any StatementAbc node.
visit_struct_definition(node)
#
Visit StructDefinition node.
visit_structured_documentation(node)
#
Visit StructuredDocumentation node.
visit_try_catch_clause(node)
#
Visit TryCatchClause node.
visit_try_statement(node)
#
Visit TryStatement node.
visit_tuple_expression(node)
#
Visit TupleExpression node.
visit_type_name_abc(node)
#
Visit any TypeNameAbc node.
visit_unary_operation(node)
#
Visit UnaryOperation node.
visit_unchecked_block(node)
#
Visit UncheckedBlock node.
visit_user_defined_type_name(node)
#
Visit UserDefinedTypeName node.
visit_user_defined_value_type_definition(node)
#
Visit UserDefinedValueTypeDefinition node.
visit_using_for_directive(node)
#
Visit UsingForDirective node.
visit_variable_declaration(node)
#
Visit VariableDeclaration node.
visit_variable_declaration_statement(node)
#
Visit VariableDeclarationStatement node.
visit_while_statement(node)
#
Visit WhileStatement node.
visit_yul_abc(node)
#
visit_yul_assignment(node)
#
Visit YulAssignment node.
visit_yul_block(node)
#
visit_yul_break(node)
#
visit_yul_case(node)
#
visit_yul_continue(node)
#
Visit YulContinue node.
visit_yul_expression_statement(node)
#
Visit YulExpressionStatement node.
visit_yul_for_loop(node)
#
Visit YulForLoop node.
visit_yul_function_call(node)
#
Visit YulFunctionCall node.
visit_yul_function_definition(node)
#
Visit YulFunctionDefinition node.
visit_yul_identifier(node)
#
Visit YulIdentifier node.
visit_yul_if(node)
#
visit_yul_leave(node)
#
visit_yul_literal(node)
#
Visit YulLiteral node.
visit_yul_statement_abc(node)
#
Visit any YulStatementAbc node.
visit_yul_switch(node)
#
visit_yul_typed_name(node)
#
Visit YulTypedName node.
visit_yul_variable_declaration(node)
#
Visit YulVariableDeclaration node.