Compare commits

...

3 Commits

Author SHA1 Message Date
Gal bdee60426f
Add README 2024-02-09 01:20:12 +01:00
Gal 7244e5601b
Add sample code 2024-02-09 01:19:29 +01:00
Gal a4e804a67d
Fix breaks 2024-02-09 01:18:48 +01:00
3 changed files with 11 additions and 0 deletions

View File

@ -13,4 +13,10 @@ cd ..
java -cp bin com.craftinginterpreters.lox.Lox java -cp bin com.craftinginterpreters.lox.Lox
jlox [script] jlox [script]
```
Or
```
java -cp bin com.craftinginterpreters.lox.Lox sample-code.lox
``` ```

3
sample-code.lox Normal file
View File

@ -0,0 +1,3 @@
/* This is a block comment
It has a new line */
abc==123

View File

@ -95,8 +95,10 @@ class Scanner {
break; break;
case '=': case '=':
addToken(match('=') ? EQUAL_EQUAL : EQUAL); addToken(match('=') ? EQUAL_EQUAL : EQUAL);
break;
case '<': case '<':
addToken(match('=') ? LESS_EQUAL : LESS); addToken(match('=') ? LESS_EQUAL : LESS);
break;
case '>': case '>':
addToken(match('=') ? GREATER_EQUAL : GREATER); addToken(match('=') ? GREATER_EQUAL : GREATER);
break; break;