Implemented typeof and added resetInterpreter()

This commit is contained in:
2022-09-05 10:56:35 +01:00
parent 2a3206d951
commit 2aecf6e8a1
11 changed files with 125 additions and 66 deletions

View File

@@ -31,17 +31,18 @@ DONE: are compounds shallow or deep copies? Deep copies
DONE: third output stream, for lexer/parser/compiler/interpreter errors
DONE: Assertion-based test scripts
DONE: Import/export keywords
DONE: A way to check the type of a variable (typeOf keyword)
TODO: slice and dot notation around the builtin _index function
TODO: ternary operator
TODO: Nullish types?
TODO: A way to check the type of a variable (typeOf keyword)
TODO: a = b = c = 1; ?
TODO: hooks on the external libraries, triggered on import
TODO: standard library
TODO: external script runner library
TODO: document how it all works - book?
TODO: maximum recursion/function depth
NOPE: a = b = c = 1;
NOPE: functions return a set number of values

View File

@@ -49,6 +49,7 @@ The following list of keywords cannot be used as names, due to their significanc
* string
* true
* type
* typeof
* var
* while
@@ -163,11 +164,7 @@ var bar = "hello world";
var buzz;
```
Variables can be used in place of values at any time, and can be altered and re-assigned. Multiple variables (which have been previously declared) can be assigned to the same value:
```
a = b = c = 1;
```
Variables can be used in place of values at any time, and can be altered and re-assigned.
## If-Else