Before us is Mishnah 2 in the third chapter of Maseches Shevuos, which deals with the question of when a single statement counts as one oath, and when it counts as several oaths, each one obligating on its own.
The first case - an inclusive formulation:
"Shevuah shelo ochal, ve'achal pas chittin u'fas se'orin u'fas kusmin - eino chayav ela achas" - one who swore that he would not eat, and after his oath he ate three different kinds of bread: wheat bread, barley bread and spelt bread. Even though he ate three kinds of food, he is liable only once - a single chatas if he violated his oath unintentionally, or lashes if he did so intentionally. The reason: once he swore in an inclusive formulation that he would not eat, he included in his oath every form of eating and every kind of food together as one.
The second case - a detailed formulation:
"Shevuah shelo ochal pas chittin u'fas se'orin u'fas kusmin, ve'achal - chayav al kol achas ve'achas" - here, at the time of his oath, the one swearing specified three different kinds (and these are only examples), and when he ate all three of them he became liable for each and every one as an oath in its own right.
The reason for the distinction: even though he opened by saying "shevuah" and mentioned that word only once, the very fact that he specified three separate items - this bread and this bread and this bread - which are ordinarily included together under one heading, shows that his intention was to accept upon himself a separate oath for each one of them. Therefore he is liable for each one on its own.
In summary: everything depends on the wording of the oath. One who swears in an inclusive formulation, "Shevuah shelo ochal," has included in his oath all foods together and is liable only once; but one who specifies several kinds in his oath has revealed his intent that he accepted upon himself a separate oath for each and every kind, and he is liable for each and every one.