Cleanup and followup to PR #17830: parsing changes

Followup to PR #17830. Prevents breaking down unquoted `$name` tokens into separate `$` and `name`.
Reports unknown macro variables (with correct span).

Fixes #18775 (finally...)
Fixes #18839
Fixes #15640
this fixes #15640