So... you don't indent your bracket blocks?
- Step 1: Find open bracket
- Step 2: Find closed bracket
With indentation, the algorithm now becomes:
- Step 1: Find something which seems to open a scope.
- Step 2: Scan all indentation level until it's done.
The difference is huge here.
Step 2: Find the first place where the indent becomes lower.
It's not hard, human vision is naturally designed for this. What is hard is finding a matching bracket when the code is not indented properly.
I have a different algorithm:
- Find first indented line
- Find next unindented line
If that does not work for you, your code is bad.