- 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:)
the function will create a fiber and execute the function, this is
a better abstracion for the host applicaion (createFiber, runFiber
are removed) and this will come in handy when it comes to execute
pocket functions inside a native function (it's required to
implement operator overloading).
this is necessare to make classes inherit from unknown
identifiers which are resolved at the runtime
and if we were to write the byte code to a file and run it, the globals
should be initialized at the runtime since there isn't any compile
time for them (pre compiled).
When parsing class and if there is an EOF it's not being marked
as an error which is a regression after the syntax error refactor
which is fixed.
Constructor of boolean class return C boolean instead of VAR_BOOL()
bug fixed
pkVar is removed and slots (like wren) are implemented for accessing or passing pocketlang values to C and vice versa. Yet all the slot related functions are callable at runtime (a fiber is associated with the VM) which needs to be refactored to allocate slots even if it's not runtime, to let users make use of the pocketlang values before or without running a function.
As of this commit there is only one method in the entier pocketlang
thats List.append() have added (the reset is todo).
method searching algorithm should be optimized in the future by
sorting the methods according to their names and do a binary search