mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Reworked the tests, read more
I've brought the tests up to scratch, except for compounds im the parser, because I'm too damn tired to do that over SSH. It looks like collections are right-recursive, whixh was unintended but still works just fine. I've also added the '--verbose' flag to the repl to control the debugging output. Several obscure bugs have been fixed, and comments have been tweaked. Mustfail tests are still needed, but that's a low priority. See #142. Fixed #151
This commit is contained in:
@@ -26,8 +26,8 @@ This repository holds the reference implementation for Toy version 2.x, written
|
||||
//print is a built-in keyword, that can handle complex expressions
|
||||
print 6 * 7;
|
||||
|
||||
//strings can be concatenated with the .. operator
|
||||
print "Hello" .. "world!";
|
||||
//strings can be concatenated with the .. operator, and substringed with the [] operator
|
||||
print "Hello" .. "world!"[3, 3]; //[index, length] - this prints "low"
|
||||
|
||||
//variables are declared easily
|
||||
var foobar = 42;
|
||||
@@ -40,7 +40,10 @@ var foobar = 42;
|
||||
//the types default to 'any' but can be specified if needed (same with constants)
|
||||
var immutable: string const = "Foobar";
|
||||
|
||||
//more examples to be added as the features are implemented
|
||||
//the assert keyword can check an expression, and takes an optional second parameter
|
||||
assert immutable == "Fizzbuzz", "This message is sent to the terminal by default";
|
||||
|
||||
//NOTE: This section will be expanded as more features are implemented
|
||||
```
|
||||
|
||||
# Building
|
||||
|
||||
Reference in New Issue
Block a user