search: refactor pattern scanner to recognize NOT keyword
Created by: rvantonder
A clean up of ScanBalancedPattern
that addresses an issue with not
I found along the way:
-
(foo not bar)
->not
keywords inside parentheses were not treated as keywords, but patterns -
(not foo)
-> extra scanner handling to detect whennot
keyword happens after an opening paren
I've documented the ScanBalancedPattern
more clearly because it's really the crux of making patterns play nice with our own language syntax. The same logic has to go in the frontend parser, which is why I did a pass on this.