Skip to content

Hero472/langscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langscript

Features

Lexer

  • 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 and for expressions (for being a syntactic sugar of while)
  • Supports break statement
  • Supports first class functions
  • Supports anonymous functions

Prerequisites

Ensure you have Rust installed. You can install it from rust-lang.org

Installation

  1. Clone this repository
git clone https://github.com/Hero472/langscript.git
cd langscript
  1. Build the project
cargo build
  1. Run the project
cargo run
  1. Test the project
cargo test

Usage

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.

Roadmap

  • Add parser.
  • Add Interpreter.
  • Add functionality with let
  • Add functionality with if and else
  • Add functionality with while
  • Add functionality with for
  • Add functionality with fun
  • Add functionality with return
  • Add funciontality with class
  • Add functionality with methods

Contributing

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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages