Takes JavaScript code as input and verifies whether it is syntactically valid. It reports the exact line and token where a syntax error occurs, or confirms the code is error-free.
| Construct | Example |
|---|---|
| Variable declaration | var x = 5; let y; const z = "hello"; |
| Array declaration | var arr = [1, 2, 3]; |
| Function definition | function foo(a, b) { return a; } |
| If / else | if (x > 0) { ... } else { ... } |
| For loop | for (var i = 0; i < 10; i = i + 1) { ... } |
| While loop | while (x > 0) { ... } |
| Return statement | return x; |
| Assignment | x = 10; |
pip install plypython main.pyJavaScript Syntax Verifier (PLY)
1. Variable declaration/instantiation
2. Iterative constructs (for/while)
3. Selective constructs (if/else)
4. Function declaration
5. Array declaration
6. Combination of all the above constructs
7. Exit
js> var x = 10;
js> if (x > 5) { return x; }
js> exit
--- Verifying Syntax ---
Syntax is valid! No errors detected.
Vivian Sobers E — github.com/VivianSobers