def _rm_compute_leading_space(space_s_pres_split):
i = <NUM_LIT:0><EOL>c = <NUM_LIT:0><EOL>while (i < len(space_s_pres_split) and<EOL>(space_s_pres_split[i].isspace() or<EOL>(space_s_pres_split[i] == "<STR_LIT>"))):<EOL><INDENT>c += len(space_s_pres_split[i])<EOL>i += <NUM_LIT:1><EOL><DEDENT>return c<EOL>
count the number of spaces that precede a non-space token (not including
empty string tokens) in a string.

:param space_s_pres_split: the string, split into tokens around spaces,
                           but with the spaces conserved as tokens.