Skip to content

Instantly share code, notes, and snippets.

@dnmfarrell
Created July 14, 2020 18:46
Show Gist options
  • Save dnmfarrell/4d0d8f6236d38a14ac60dd580ac1f123 to your computer and use it in GitHub Desktop.
Save dnmfarrell/4d0d8f6236d38a14ac60dd580ac1f123 to your computer and use it in GitHub Desktop.
lox debug mode example
$ ./lox -d
Welcome to Lox version 0.01
> var a = 7; print (a + 4);
1 1 VAR var
1 5 IDENTIFIER a
1 7 EQUAL =
1 9 NUMBER 7
1 10 SEMICOLON ;
1 12 PRINT print
1 18 LEFT_PAREN (
1 19 IDENTIFIER a
1 21 PLUS +
1 23 NUMBER 4
1 24 RIGHT_PAREN )
1 25 SEMICOLON ;
2 1 EOF
(
(
a = 7
)
(
print
(
(
a + 4
)
)
)
)
11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment