Skip to content

colinmparker/monkey-extended

Repository files navigation

monkey-extended

monkey website

Usage

go install github.com/cmp5au/monkey-extended@latest
$(go env GOPATH)/bin/monkey-extended <options>

Options

  • monkey-extended [(-e | --engine) ]
    • start REPL using the desired engine ("vm" or "evaluator")
  • monkey-extended [(-e | --engine) ] [(-o | --out) ]
    • evaluate the input monkeyfile using the engine of choice
    • if -o,--out option is provided, engine must be "vm"
    • if file extension is not .koko, this option is the default unless additional flags are provided
  • monkey-extended [-k | --koko]
    • interpret the koko bytecode and run the program within
    • if file extension is .koko, this option is the default unless additional flags are provided

Added Behavior

  • for loops
    • break and continue control flow statements
  • variable declaration without assignment (ex: let x;)
  • variable assignment without let for declared variables (ex: x = 1;)
  • deque methods for Array type: push, pop, pushleft, popleft
  • delete builtin for removal from Array or Hash types
  • String operators: concatenation with +, comparators (==, !=, <, >, <=, >=), indexing
  • null literal
  • bytecode (de)serialization
  • support for running Monkey scripts
  • support for "less/greater than or equal to" operators <=, >=
  • compiler bugfixes in cases where last statement is not an ExpressionStatement

Simplified overview diagram

simplified overview diagram

About

Extending Thorsten Ball's Monkey language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published