Repository navigation
SCSA Pseudocode v0.3
New Language features
We aren't far from having almost all features implemented now, yay!
All New Standard Library!
Functions
- I/O Functions
PRINT(...args): Now supporting any number of arguments, delimits with space.OUTPUT(...args): Alternative toPRINTwithout trailing newline.INPUT(prompt): Reads a line of input from the user with prompt.
- Type conversion/utility functions
INT(value): Converts a value to an integer.FLOAT(value): Converts a value to a float.STRING(value): Converts a value to its string representation.BOOL(value): Converts a value to a boolean.TYPE(value): Returns the type of a given value as a string.
- Utility
RANDOM(min, max): Returns a random integer between min and max.TIME(): Returns current system time as a floating point, in seconds since epoch.
Strings and Arrays
- Strings
string[i]Indexes into a stringstring.lengthReturns the length of a stringstring.slice(a, b)Returns the substring from index a to b (inclusive)- Strings are now iterable in FOR-IN loops
- Arrays
array[i]Indexes into an arrayarray.slice(a, b)Returns a shallow copy from index a to b (inclusive)array.append(x)Appends value to the end of the arrayarray.lengthReturns length of the array as an integer
The above were implemented using Native functions, since it's now very easy to implement new native functions.
Other changes
Support for Multi-Line statements in REPL
- You can now type out long
FUNCTIONandCLASSdeclarations in REPL!
NOT keyword and != Operator
- These work about as you would expect from any programming language.
Support for NO_COLOR
NO_COLORenvironment variable is now supported in case you don't have a terminal with ANSI colours.
Integration Test Suite
- Over 100 integration tests covering every error, and all features
- Integrated into CMake for CI/CD, (Meaning it works on Windows!)
Pull Request Log
- Native Functions and standard library by @SaintNong in #4
- Unary Expressions, NOT keyword, and '!=' Operator by @SaintNong in #5
- Better CLI debugging and NO_COLOR Support by @SaintNong in #6
- Integration Test Suite by @SaintNong in #7
- Arrays and Strings Overhaul by @SaintNong in #8
- Support for Multi-Line statements in REPL by @SaintNong in #9
Full Changelog: v0.2...v0.3