def _has_nested_from_clause(sql_spans):
  """Returns True if the outer sql statement has nested from clause."""
  previous_span_was_placeholder = False
  for sql_span in sql_spans:
    if (previous_span_was_placeholder and sql_span.sql_token and
        sql_span.sql_token == '('):
      return True
    if sql_span.sql_token and sql_span.sql_token == FROM_CLAUSE_PLACEHOLDER:
      previous_span_was_placeholder = True
    else:
      previous_span_was_placeholder = False
  return False
Returns True if the outer sql statement has nested from clause.
language/xsp/data_preprocessing/abstract_sql.py