Commit Graph

16 Commits

Author SHA1 Message Date
Thakee Nathees
4f33aa7e25 types hash api implemented
and, or operators supports new line after the first
expression.
2022-06-01 18:31:51 +05:30
Thakee Nathees
d5b4b566e4 json library added
- cJSON library was added to thirdparty for json module
- json module added and json.parse() function implemented
- thirdparty library sources are directly imported
- io.readfile() function added
- less than function fix (wasn't returning boolean)
- min, max functions added
- map check values equal implemented
2022-06-01 01:49:39 +05:30
Thakee Nathees
bd61e77593 extension module implemented
now it's possible to import a dynamic libray (*.dll, *.so) in
a pocket script.
2022-05-30 22:55:22 +05:30
Thakee Nathees
1255db4bc8 import system refactored
- using normalized windows path in windows for import search.
- search path implemented, executable's path, exe/libs/ directories
  added to the search path.
- cwalk library updated after buf fix:08e7520d33
- dl library support added and will be implemented.
- generate_native.py refactored.
2022-05-30 15:48:24 +05:30
Thakee Nathees
bbafc914a0 adding string source to module added 2022-05-28 15:01:17 +05:30
Thakee Nathees
9ac483a5b0 path.listdir, dir functions were added 2022-05-28 01:13:08 +05:30
Thakee Nathees
aac9bb37f7 invalid definition inside expression fixed 2022-05-27 17:14:23 +05:30
Thakee Nathees
0cfdfa7415 New fibers are not added to temp list -- fixed 2022-05-25 00:06:44 +05:30
Thakee Nathees
8e04748f86 some builtin class methods were added
- 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
2022-05-23 23:47:28 +05:30
Thakee Nathees
6a22653263 Minor code enhancements (read bellow)
- 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.
2022-05-21 04:15:30 +05:30
Thakee Nathees
e3cab82978 amalgamation added and libs moved to src/libs/ 2022-05-20 04:49:50 +05:30
Thakee Nathees
f5e2f15d23 negative index, range slice and more
... string concat with .. operator
    exponent operator with ** operator
2022-05-08 23:19:33 +05:30
Thakee Nathees
3c107d4da2 native interface refactored 2022-05-05 12:54:15 +05:30
Thakee Nathees
1c7ddf07ad memory trace for vmRealloc implemented.
a little python script have written to check for memory leaks
from the trace report. Which is at scripts/leak_detect.py
2022-05-03 16:56:59 +05:30
Thakee Nathees
e47d982883 super class method call implemented 2022-05-01 20:24:07 +05:30
Thakee Nathees
4e9091b5ec scripts are moved to scritps/ directory 2022-05-01 14:12:27 +05:30