Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 607 Bytes

File metadata and controls

42 lines (32 loc) · 607 Bytes

Kera

An interpreter for kera language, my first attempt to create an interpreter.

Running the REPL

Using cargo

cargo run

It can now display correct expression precedence.

TODO:

  • Lexer
  • Parser
    • Statements
    • Expressions
  • Evaluation
  • REPL
  • Add more data types

Example

misal lima = 5;
misal sepuluh = 10;

misal tambah = fungsi(x, y) {
    kembalikan x + y;
}
misal larik = [1, 2, 3, tambah(lima, sepuluh)];

misal hasil = terakhir(larik);

jika hasil > 10 {
    kembalikan benar;
} lainnya {
    kembalikan salah;
}

Output: benar