docs: updating README.md

This commit is contained in:
Patrick MARIE 2024-08-27 12:21:44 +02:00
parent 28f71342a9
commit 34a40813f7

View File

@ -31,36 +31,13 @@ $ just build
$ ls -l zig-out/bin/zlox $ ls -l zig-out/bin/zlox
-rwxr-xr-x 1 mycroft mycroft 2823296 Aug 25 15:36 zig-out/bin/zlox -rwxr-xr-x 1 mycroft mycroft 2823296 Aug 25 15:36 zig-out/bin/zlox
$ set -x TRACE
$ just run $ just run
zig build run zig build run
> 2*3 + 3*4 == Hash table count:0 capacity:0 ==
== code == == End of hash table ==
0000 1 OP_CONSTANT 0 '2'
0002 | OP_CONSTANT 1 '3'
0004 | OP_MULTIPLY
0005 | OP_CONSTANT 2 '3'
0007 | OP_CONSTANT 3 '4'
0009 | OP_MULTIPLY
000a | OP_ADD
== end of code ==
0000 1 OP_CONSTANT 0 '2' zlox> print !(5 - 4 > 3 * 2 == !nil);
[ 2 ]
0002 | OP_CONSTANT 1 '3'
[ 2 ][ 3 ]
0004 | OP_MULTIPLY
[ 6 ]
0005 | OP_CONSTANT 2 '3'
[ 6 ][ 3 ]
0007 | OP_CONSTANT 3 '4'
[ 6 ][ 3 ][ 4 ]
0009 | OP_MULTIPLY
[ 6 ][ 12 ]
000a | OP_ADD
[ 18 ]
000b 2 OP_RETURN
18
> !(5 - 4 > 3 * 2 == !nil)
== code == == code ==
0000 1 OP_CONSTANT 0 '5' 0000 1 OP_CONSTANT 0 '5'
0002 | OP_CONSTANT 1 '4' 0002 | OP_CONSTANT 1 '4'
@ -73,6 +50,7 @@ zig build run
000c | OP_NOT 000c | OP_NOT
000d | OP_EQUAL 000d | OP_EQUAL
000e | OP_NOT 000e | OP_NOT
000f | OP_PRINT
== end of code == == end of code ==
0000 1 OP_CONSTANT 0 '5' 0000 1 OP_CONSTANT 0 '5'
@ -97,7 +75,11 @@ zig build run
[ false ] [ false ]
000e | OP_NOT 000e | OP_NOT
[ true ] [ true ]
000f 2 OP_RETURN 000f | OP_PRINT
true true
> 0010 2 OP_RETURN
== Hash table count:0 capacity:0 ==
== End of hash table ==
zlox>
``` ```