Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #13: Is parentheses or bracket closed properly? #16

Merged
merged 4 commits into from
Oct 19, 2020

Conversation

klee214
Copy link
Contributor

@klee214 klee214 commented Oct 19, 2020

Fix: #13
checkParenthesesBracket checks if the parentheses or bracket is closed properly.

function checkSyntax(compiledCode) {
	let checkPassed = true;
	let splitCode = compiledCode.split(";");

	if (!checkParenthesesBracket(splitCode)) checkPassed = false;

	splitCode = compiledCode.split(" ");
	if (!checkAsyncFunctionCalls(splitCode)) checkPassed = false;

	return checkPassed;
}

Output:

[*] Executing lexer...
[OK] Lexer finished successfully!
[*] Transpiling...
[OK] Transpilation complete!
[*] Running syntax checker & linter...
[WARN] '(' is not closed. This could cause syntax errors: console.log("Welcome to GreenLight!"
[WARN] Syntax checker found at least one issue in your code!

@klee214
Copy link
Contributor Author

klee214 commented Oct 19, 2020

If there is anything I have done, or need to fix. Please let me know!!

@PrivateGER
Copy link
Owner

Looks good! Thanks for the contribution!

@PrivateGER PrivateGER merged commit 5bfe3b7 into PrivateGER:master Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add syntax checker
2 participants