34. is_local_xxx ast helpers

The is_local module exposes collection of helper routines to establish locality of expression.

All functions and symbols are in “is_local” module, use require to get access to it.

require daslib/is_local

34.1. Scope checks

is_local_expr(expr: ExpressionPtr)

is_local_expr returns bool const

argument

argument type

expr

ExpressionPtr

Returns true if the expression is local to the current scope.

is_local_or_global_expr(expr: ExpressionPtr)

is_local_or_global_expr returns bool const

argument

argument type

expr

ExpressionPtr

Returns true if expression is local the current scope or global scope.

is_scope_expr(expr: ExpressionPtr)

is_scope_expr returns bool const

argument

argument type

expr

ExpressionPtr

Returns true if the expression is a scoped expression, i.e. eventually points to a variable.

34.2. Uncategorized

is_temp_safe(expr: ExpressionPtr)

is_temp_safe returns bool const

argument

argument type

expr

ExpressionPtr

Returns true if the exression had no calls, [] or table [] operators of any kind. This is used to check expression can be safely casted to temp type. local variables are ok we can do swizzle on result we get to foo() which returns something &

is_shared_expr(expr: ExpressionPtr)

is_shared_expr returns bool const

argument

argument type

expr

ExpressionPtr

Returns true if the expression is local to the current scope.