Is it necessary to write the word: "for lunch" separately?
To understand this, you need to determine which part of speech the word belongs to.
Let's ask a question. "What to do? ". to dine ( ) is a verb. According to the rules of the Russian language, verbs are not written together with prepositions.
but!
In our case, "by" is a prefix, so the correct way to write the word together is "to dine".
grammar
Russian proverbs.