ArcaneScript is a custom programming language developed to explore language design and interpretation. This project includes the development of both the ArcaneScript language and its online Runner.
ArcaneScript currently does not support the else if construct within conditional statements, making it impossible to create an if-else if-else ladder. This limitation restricts developers from implementing multiple condition checks in their scripts, which is a fundamental feature of most programming languages.
Observe that the else if condition does not work, and the code either produces an error or skips the else if block entirely.
Expected Behavior:
The script should check the conditions in sequence:
If v == 6, it should print "If Works".
If v == 7, it should print "Else if works".
Otherwise, it should print "Else works".
Actual Behavior:
The else if block is not recognized, causing the conditional statement to either result in an error or default directly to the else block, ignoring any intermediate conditions.
Suggested Solution:
Update the parser and grammar rules of ArcaneScript to include support for else if statements.
Ensure that the else if construct is correctly recognized and executed as part of the conditional ladder.
Add tests to validate the functionality of if-else if-else ladders for different types of conditions.
Priority: High
Conditional ladders are essential for implementing complex logic in scripts, and the lack of this feature limits the functionality of ArcaneScript significantly.
Description:
ArcaneScript currently does not support the
else if
construct within conditional statements, making it impossible to create anif-else if-else
ladder. This limitation restricts developers from implementing multiple condition checks in their scripts, which is a fundamental feature of most programming languages.Steps to Reproduce:
else if
condition does not work, and the code either produces an error or skips theelse if
block entirely.Expected Behavior:
The script should check the conditions in sequence:
v == 6
, it should print"If Works"
.v == 7
, it should print"Else if works"
."Else works"
.Actual Behavior:
The
else if
block is not recognized, causing the conditional statement to either result in an error or default directly to theelse
block, ignoring any intermediate conditions.Suggested Solution:
else if
statements.else if
construct is correctly recognized and executed as part of the conditional ladder.if-else if-else
ladders for different types of conditions.Priority: High
Conditional ladders are essential for implementing complex logic in scripts, and the lack of this feature limits the functionality of ArcaneScript significantly.