A post should be marked as spam only if it advertises a product, service, or similar and is unsolicited or lacks disclosure.
(source)
I honestly don't see how you can consider this:
I'm familiar with the pyparsing library in Python, which uses overloaded operators in Python to implement a combinator approach to building up parsers.
to be an attempt at spamming. Specially if the rest of the answer tries to explain with an code example how the OP might reach their goal. Now, as stated by others, that answer was on a Haskell question so it was slightly out of touch but it was an honest attempt by an user with 41,2K reputation to provide an useful answer. If cross contamination between tags is not allowed, nor providing answers for the libraries/languages our users developed, this site is doomed.
At best you should have used a custom moderator flag to explain what is bothersome about the answer. That allows you to explain your reasoning which gives the moderator the opportunity to weigh if there is merit in that.
Your spam flag will have consequences though, when the moderator marks it valid. It will give a -100 reputation penalty and the account is marked for spam activity, if you manage to do that often enough you IP-ban one of the long standing contributors to the site.
You need to adjust your spam detection. This is what spam looks like:

and is 99 out of 100 posted by 1 rep users. If you decide to red flag a post from a user that is in good standing, make sure you're 100% sure what you're doing and a custom flag is probably better in those cases.
The post you flagged isn't near this daily crap with spam we see. The flag was correctly declined.