Let's say I have the following string:
if(something){ /* do stuff */ }else if(something_else){ /* do other stuff */ }else{ /* do stuff once more *}
What I want is to verify that the if syntax in this string is correct. For example make sure that the else{} statement is not before the else if(){} statement or that a bracket is not left open etc...I don't care about the code inside the brackets. The string could have any number of "if else" statements and it could have or not have an "else" statement.
I have already writen a function to check it but if there is a library or a script for stuff like this I 'd prefer using it.