IntegralFox/undent — pull request #1 by mshoward (2014-08-11 04:11:44+00:00)
Title: Added enclosing characters checking

I added a "syntax checker" class. Usage is setting the opening and closing strings as opposites, e.g. "{([" for opening and "])}" for closing, then pushing all characters in the file with this.pushAlt(char a)... It handles comparisons and whatnot itself and doesn't push unused characters.

if you want to push characters and do the comparisons yourself, use this.pushOpen(char a) and this.pushClose(char a). Syntactically incorrect code will naturally generate an error in use.

to check validity, just call the functor object, and it'll return it's current state of validity in slightly above linear time on size of it's internal stack, worst case.