The tricky thing is: it could also be `foo.    (42)` or `foo.NEWLINE(42)`. I think the best way to handle this is to loop through all space like characters until the next non space character is found and return the rest of it. We do something similar here:

https://github.com/bellthoven/elixir/blob/bd6f27a5d5c7cce3d8214822f93fa0201ecc7994/lib/elixir/src/elixir_tokenizer.erl#L605

Furthermore, we have this issue not only for `foo. (42)` but also `foo. <<>>(42)` and more. That said,  I think the best approach would be to discard all space characters after you find the dot and then match on the rest. We will need to match all these clauses:

https://github.com/bellthoven/elixir/blob/bd6f27a5d5c7cce3d8214822f93fa0201ecc7994/lib/elixir/src/elixir_tokenizer.erl#L214-L251

If none of those clauses match, we should tokenize just the `.` (i.e. this clause: https://github.com/bellthoven/elixir/blob/bd6f27a5d5c7cce3d8214822f93fa0201ecc7994/lib/elixir/src/elixir_tokenizer.erl#L376)

Check the next token


If the next space is a `$(` it is a fun call (as in this clause). If it is a quote `$'` or `$"`, it is the next clause, if it is anything else, we should tokenize just the dot