Skip to content

Commit

Permalink
add screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
useEffects committed Jul 29, 2024
1 parent dabd695 commit 97cccea
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Golang implementation of a basic tree walk interpreter.

<img src="./assets/screenshot.png" />

Find the binaries for windows, linux and macos under the releases section.

https://craftinginterpreters.com/
Expand Down
Binary file added assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion test.lox
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,23 @@ fun makeCounter() {
var counter = makeCounter();
print counter(); // 1
print counter(); // 2
print counter(); // 3
print counter(); // 3

// Classes and inheritance
class Animal {
speak() {
print "The animal makes a sound.";
}
}

class Dog < Animal {
speak() {
print "The dog barks.";
}
}

var animal = Animal();
animal.speak(); // The animal makes a sound.

var dog = Dog();
dog.speak(); // The dog barks.

0 comments on commit 97cccea

Please sign in to comment.