module Solargraph::Parser::ParserGem::NodeMethods::DeepInference

Concepts:

- statement - one single node in the AST.  Generally used
  synonymously with how the Parser gem uses the term
  'expression'.  This may have side effects (e.g.,
  registering a method in the namespace, modifying
  variables or doing I/O).  It may encapsulate multiple
  other statements (see compound statement).

- value - something that can be assigned to a variable by
  evaluating a statement

- value node - the 'lowest level' AST node whose return
  type is a subset of the value type of the overall
  statement.  Might be a literal, a method call, etc - the
  goal is to find the lowest level node, which we can use
  Chains and Pins later on to determine the type of.

  e.g., if the node 'b ? 123 : 456' were a return value, we
  know the actual return values possible are 123 and 456,
  and can disregard the rest.

- value type - the type representing the multiple possible
  values that can result from evaluation of the statement.

- return type - the type describing the values a statement
  might evaluate to.  When used with a method, the term
  describes the values that may result from the method
  being called, and includes explicit return statements
  within the method body's closure.

- method body - a compound statement with parameters whose
  return value type must account both for the explicit
  'return' statemnts as well as the final statements
  executed in any given control flow through the method.

- explicit return statement - a statement which, when part of a
   method body, is a possible value of a call to that method -
   e.g., "return 123"

- compound statement - a statement which can be expanded to
   be multiple statements in a row, executed in the context
   of a method which can be explicitly returned from.

- value position - the positions in the AST where the
  return type of the statement would be one of the return
  types of any compound statements it is a part of.  For a
  compound statement, the last of the child statements
  would be in return position.  This concept can be applied
  recursively through e.g. conditionals to find a list of
  statements in value positions.