Skip to content
/ golox Public

An implementation of the Lox language written in go.

Notifications You must be signed in to change notification settings

AnshVM/golox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

golox

An implementation of the Lox language written in go.

Additional features

  • Multiline comments

    /* This is
    a multiline 
    comment */
    
  • Anonymous functions

    Anonymous functions for use cases like passing functions as arguments.

    fun thrice(fn) {
      for (var i = 1; i <= 3; i = i + 1) {
        fn(i);
      }
    }
    
    thrice(fun (a) {
      print a;
    });
    // "1".
    // "2".
    // "3".
    

Usage

Make sure you have golang installed.

$ git clone https://github.com/AnshVM/golox.git
$ cd ./golox
$ go build
$ ./golox

This will fire up the lox REPl

For running a lox file -

$ ./golox filepath.lox

About

An implementation of the Lox language written in go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages