- tokenize from concrete syntax.
- Supports basic arithmetic operations:
+
,-
,*
,>
,<
and/
. - Supports
()
{}
paren and braces. - Supports
,
.
;
*
!
tokens. - Supports two char tokens like
!=
- Supports
//
line comments - Supports String, Number and Identifiers and their operations
- Supports
print
- Supports Expressions (Assign, Logical, Binary, Group, Literal, Unary, Ternary, Variable)
- Supports scopes with different environment
- Supports
while
andfor
expressions (for
being a syntactic sugar of while) - Supports
break
statement - Supports first class functions
- Supports anonymous functions
Ensure you have Rust installed. You can install it from rust-lang.org
- Clone this repository
git clone https://github.com/Hero472/langscript.git
cd langscript
- Build the project
cargo build
- Run the project
cargo run
- Test the project
cargo test
do cargo run
to play with the interpreter and also now you can code, with the command cargo run [path]
you can run any code you have with any extension.
- Add parser.
- Add Interpreter.
- Add functionality with
let
- Add functionality with
if
andelse
- Add functionality with
while
- Add functionality with
for
- Add functionality with
fun
- Add functionality with
return
- Add funciontality with
class
- Add functionality with
methods
Feel free to fork this repository, submit issues, or contribute to the project by creating pull requests.
There are yet things to optimize in the code and also to see the limit cases on whats written in the source code, so feel free to test the code here!