What is flavored syrup hardened into small pieces for eating?

You're describing candy.

Specifically, you're likely thinking of hard candy or boiled sweets, which are made by boiling sugar syrup with flavorings and then letting it cool and harden into small pieces.

However, other types of candy can also be made with flavored syrup, like:

* Lollipops: These are hard candies on a stick.

* Chewy candies: These can be made with syrup and other ingredients like corn syrup and gelatin.

* Gummy candies: These are made with gelatin, sugar, and flavoring.