Poor baby maitra is too busy to add mobile responsiveness.
Please be a good person and use desktop 🥺
Syntax checker
It does the following things:
1. Checks your code for {} () [] brackets.
2. Ignores the brackets if they are part of a string.
It uses Stack data structure to do this. This is how it works:
1. Each opening bracket is pushed into the stack with its position.
2. If it is a closing bracket, then it should match the top/last correspoding opening bracket. If it does the comparision continues.
3. If the stack is empty and we still receive an closing bracket then it gives "Unexpected closing bracket at position x" error.
4. If comparision is completed and stack is not empty then it gives "Unmatched opening bracket at position x" error.
5. If the comparision is completed and stack is empty then it gives "All brackets correctly matched" confirmation.
For knowing how it ignores string containing brackets and Source code, visit the GitHub Repo
Scroll for code samples to test.
maitra likes practical stuff, here's the github repo for this page