The Stack with Objects and Functions Programming Language, a pure stack-based reverse-polish-notation functional and object-oriented experimental programming language.
The Preprocessor tries to ensure that all code block braces match up. However, it primitively only checks the characters themselves, not whether they occur as a separate token. Therefore, curly braces which are part of a string (common, critical) or invalid token are also counted
To Reproduce
Run the following code through the preprocessor:
{ 4 5 "some tokens" writeln} .
Notice the missing space after writeln. The preprocessor will accept this code as legal, causing the interpreter to fail undeterministically.
Expected behavior
The above code should be rejected. Curly braces in non-token positions should not be counted.
Platform information
Output of java -version: openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
Output of sof -v: sof version 0.1 (built 04.07.20, 20:33)
Describe the bug
The Preprocessor tries to ensure that all code block braces match up. However, it primitively only checks the characters themselves, not whether they occur as a separate token. Therefore, curly braces which are part of a string (common, critical) or invalid token are also counted
To Reproduce
Run the following code through the preprocessor:
Notice the missing space after
writeln
. The preprocessor will accept this code as legal, causing the interpreter to fail undeterministically.Expected behavior
The above code should be rejected. Curly braces in non-token positions should not be counted.
Platform information
java -version
: openjdk version "14.0.1" 2020-04-14 OpenJDK Runtime Environment (build 14.0.1+7) OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)sof -v
: sof version 0.1 (built 04.07.20, 20:33)