How do you tell a *spelling mistake* from a *grammar mistake*? For example:

1. Your the best.
2. This iz the end.
3. I likes music.
4. She preatend to be asleep.

If we use the pronunciation criterion (if the sentence sounds correct then it has a spelling mistake, otherwise it has a grammar mistake), 1 and 2 have spelling mistakes, and 3 and 4 have grammar mistakes.

If we use the lexicon criterion (if the sentence uses a word that does not exist in the language, then it has a spelling mistake, otherwise it has a grammar mistake), 1 and 3 have grammar mistakes, and 2 and 4 have spelling mistakes.