- Objects that weren't pushed to PKVM's temp reference were fixed
- vm->bytes_allocated was modified after the re-calculation of garbage
collection fixed.
The primary purpose of this change is to disambiguate between
`else if` and `else \n if`.
Even though it's a breaking change, since it's at the very early
state we're allowed to make such breaking syntax change.
lang.write function moved to io and io.stdin, io.stdout, io.stderr
added for future streamed io operations
io.File read, write, open, close, getline, seek, tell implemented
str * int multiplication implemented
- check a string contains another with `in` keyword
- Number: isint, isbyte
- String: find, replace, split, startswith, endswith, strip
- Map: clear, has, get, pop
- list: insert, clear, find, pop
- removed str_sub builtin function as its redunent since we have
range slice over strings.
- moved lower, upper attributes of strings as methods
- ByteBuffer, and Vector classes were created. However thier methods are
limited, and to do.
- Strings supports new line escape "\\n".
- typename will return class name of an instance (was just 'Inst' fixed)
- _repr() method added. if _str method doesn' exists on an instance,
it'll try to call _repr() to make a string.
- number.isint(), number.isbyte() method added
- [], []= operator were added.
- Warnings were fixed
- Libraries are registered internally when PKVM created
and cleanedup when PKVM freed (if PK_NO_LIBS not defined)
- Lang.clock() moved to time module and sleep, epoch time
were added.
- Support both upper case and lower case hex literals
- Support hex excaped characters inside strings (ex: "\x41")
- Native api for import modules added `pkImportModule(...)`
- pkAllocString, pkDeallocString are changed to pkRealloc.
- NewInstance, DeleteInstance functions now take PKVM however
delete function should not allocate any memory since it's
invoked at the GC execution.
pkSetGlobal function implemented to support adding globals from the
native interface. Also the PKVM slots doesn't need a runtime anymore to
use them (see math.PI global to see how it works).
- all import statement (native or script file) have the same syntax
- allow relative (including parent directory) imports
- cyclic imports are handled by caching the scripts
- `import foo` can potentially import `<searchpath>/foo/_init.pk`
- * import are not supported anymore
stack realloc wasn't update the next callframe's base pointer which
caused a crash which is fixed
infinit recursions are now handled properly. now it'll dump the stack
frames and exit properly
at this point only binary operators are implemented, unary are yet
to do.
getters and setters for native classes implemented with the names
@getter, and @setter (however the names or arity aren't validated
at the moment TODO:)