The name script is missleading as it only refering to the scripts
(the files that contain the statements) where as it could also
be the native module objects containing collection of native
functions.
After this commit, native functions can also have set owner module
and it won't be as confusing as before.
Since the functions and classes will be moved to the constants buffer
rather than having their own (function buffer and class buffer) the
rename is essential, and to make the refactoring process easier all the
intermediate steps are done with its own pr.
It's just the types that were added and only object creation
and garbage collection of that types are implemented, the
reset of the implementation is not part of this commit.
* and / or logic refactored
* and / or opcodes added and stack size bug fixed
- and / or keywords were added.
- class construction function not poping the class instance
from the stack (fixed).
There are small typos in:
- README.md
- cli/modules.c
- src/pk_compiler.c
- src/pk_core.c
- src/pk_opcodes.h
- src/pk_vm.h
- tests/benchmarks/benchmarks.py
Fixes:
- Should read `temporary` rather than `temproary`.
- Should read `stdout` rather than `stdour`.
- Should read `sprintf` rather than `spritnf`.
- Should read `splitted` rather than `splited`.
- Should read `script` rather than `scirpt`.
- Should read `reported` rather than `repored`.
- Should read `reduce` rather than `recude`.
- Should read `performance` rather than `preformance`.
- Should read `instead` rather than `insted`.
- Should read `default` rather than `defalt`.
* Added log and round functions to math module
* Added log and round functions to math module
* Added a few math functions
* Static checks
* Maybe this will fix linux
* Fixed errors with styles and tests
This function takes in 3 arguments: the string, the position and the
length (of the substring). As a quick example, a call to the function
`str_sub('c programming', 3, 11)`
will return the string 'programming' as the substring to the string
that is provisioned to the function call.
Functions added are: `sinh(x)`, `cosh(x)`, `tanh(x)`, `asin(x)`,
`acos(x)`, and `atan(x)`.
In addition, basic tests added in core.pk for these functions.
* argparse library added to third parth.
We're using argparse (https://github.com/cofyc/argparse) repo to parse
cli args.
* parsed arguments applied to the cli.
Co-authored-by: Derick Alangi <alangiderick@gmail.com>
In conjunction with the ASCII char set, a byte should be any valid
character mapping to an integer between -128 to 127 (that is signed
integers as well).
Anything beyond can't fit into a byte hence this can't be a character
but 2 characters.