See https://www.youtube.com/watch?v=vcFBwt1nu2U&t=3178s
- Clone the repo
- Open in Intellij
- (You may need to link the dependencies in the lib directory)
- The
main
is in src/Main.java - Change the code in YOUR_BS_PROGRAM to make some BS!
- (Sorry if some error messages are in french, this project is using a modified version of a compiler I created for my other project, AliveScript: https://github.com/ALIVEcode/ALIVEcode/tree/master/Interpreteur)
supported features are marked as done
-
All variable names must start with €
-
Functions definition and function call
-
echo
to print -
support for numerical data types
-
Code blocks are defined by indentation
- 1 level of indentation: 2 spaces
- 4 spaces -> 1 tab
ex: 3 levels of indentation = 1 tab + 2 spaces
-
Odd number of spaces and tab (combined) are comments
-
Multiline coments start with 1 tab + 1 space and end with 1 space and 1 tab
-
Has
null
-
if
statement doesn't exit, we useunless
statement instead- value
unless
not_condition
- value
-
The
unless
statement ends with a greek question mark ; (which is not a semi-colon) -
There's only one exception, and it is
HALT_AND_CATCH_FIRE
(yes, it is a reserved keyword) -
Inference equality (like javascript)
0 = '0'
is false0 == ''
is true0 == '0'
is true0 == 'Zero'
is true22/7 == 🥧
is trueundefined !=! null
is true
-
strict equality
- If you wish for strict inequality, put a bang! after the equal, cause it is an important check!
- ex:
1 != '1'
is false but1 !=! '1'
is true - If you wish for strict equality, inverse the result of the strict inequality with a band ! before it!
- ex:
1 == '1'
is true but1 !!=! '1'
is false
-
Strings (partially implemented. For now, only one type and it is utf-8)
- 'Hello' // ASCII
- ''Hello'' // ANSI
- "Hello" // DBSC
- ""Hello"" // EBCDIC
- «Hello» // UTF-256
- ««Hello ${name}»» // UTF-256 + interpolation
-
Arrays
- Arrays indices start at -1 and go down