Fix potential grammar error
Description
Fix a potential bug in the grammar, that could lead to having cos() been evaluated, resulting in a random outcome.
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.