Skip to content

togami2864/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toy-Calculator

This is toy project to learn

  • how to create lexer, parser
  • how to work interpreter

Also, this is the good theme to exercise a new programming language you're learning.

Tags

toy Rust

Installation

$ git clone https://github.com/togami2864/calculator.git
$ cargo build
$ cargo run

Minimal Example

$ cargo run
> 1 + 1
2
> 2 - 1
1
> 2 * 3
6
> 2/2
1
> (1 + 1) * 5
10
> 1 / 0
DivisionByZero: This operation will panic at runtime
> ( 2 + 4 (
UnexpectedToken: Expected ), but got (
> a
Illegal Token: Illegal
> ....

About

toy calculator written in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages