Dehydra API: Difference between revisions

(function body)
Line 20: Line 20:
</dl>
</dl>


=== process_function(func, body) ===
=== process_function(decl, body) ===


Dehydra calls this for each top-level function or class member function. func is a JS object with the function name, type, location, and isStatic property. body is an array of objects representing the statements in the body AST.
Dehydra calls this for each top-level function or class member function.  
 
<dl>
<dt>.decl
<dd>The function declaration.
<dl>
<dt>.name
<dd>The function name.
<dt>.type
<dd>The function type, including parameter types.
<dt>.loc
<dd>Source location of the function
<dt>.isStatic
<dd>True if the function is static
<dt>.memberOf
<dd>Class containing the function, if any.
</dl>
 
<dt>.body[_]
<dd>The function body is an array with an element for each statement.
<dl>
<dt>.loc
<dd>Source location of the statement
<dt>.statements
<dd>Substatements--each element represents a value referenced in the statement.
</dl>
 
</dl>


=== process_var(decl) ===
=== process_var(decl) ===
313

edits