Utility methods related with the type join points.

Constructors

Methods

  • Makes sure the given parameter is an expression join point.

    Parameters

    • $expression: undefined | Expression

      If a string, returns a literal expression with the code of the string. Otherwise, returns $expression

    • isOptional: boolean = false

      If false and $expression is undefined, throws an exception. Otherwise, returns undefined if $expression is undefined.

    Returns undefined | Expression

  • Makes sure the given parameter is a statement join point.

    Parameters

    • code: undefined | Joinpoint

      If a string, returns a literal statement with the code of the string. Otherwise, tries to transform the given node to a $statement

    • isOptional: boolean = false

      If false and code is undefined, throws an exception. Otherwise, returns undefined if code is undefined.

    Returns undefined | Statement

  • Makes sure the given parameter is a type join point.

    Parameters

    • $type: Type

      If a string, returns a literal type with the code of the string. Otherwise, returns $type

    Returns Type

    This method does not do anything, it is only kept for compatibility with the old API

  • Parameters

    • $type: Type
    • exprFunction: ((expr: Expression) => void)

      A function that receives an $expr join point

        • (expr): void
        • Parameters

          Returns void

    Returns Type

    The $type after applying the given exprFunction to its $expr nodes. If any of the fields of the type is visited, a copy of the type is returned.