Commit Graph

53 Commits

Author SHA1 Message Date
Thakee Nathees
2713aaba35 operator overloading implementation.
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:)
2022-04-30 21:35:02 +05:30
Thakee Nathees
87fe3b01d6 runFunction() abstraction to hide fiber creation
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).
2022-04-27 08:46:00 +05:30
Thakee Nathees
d431dd7975 error pretty print (print lines) implemented
also support ansi color to highlight the error token.
2022-04-22 17:51:17 +05:30
Thakee Nathees
b285336895 fiber stored as register variable
and the benchmark script refactored, and now it will generate an
html report
2022-04-14 08:01:16 +05:30
Thakee Nathees
d3bcbfb779 try-online output changed to <pre> tag 2022-04-07 16:47:22 +05:30
Thakee Nathees
9b7ad74a7c pk_var changed to pk_value and some minor changes 2022-04-07 06:13:29 +05:30
Thakee Nathees
dfd1c5a612 false positive assertion crash -- fixed 2022-04-06 19:08:07 +05:30
Thakee Nathees
adcd7dce45 Merge pull request #180 from ThakeeNathees/minor-changes
Stack miss calculation bug fix & minor changes
2022-04-06 11:26:32 +05:30
Thakee Nathees
2bc09f41e5 Stack miss calculation bug fix & minor changes 2022-04-06 08:56:51 +05:30
Thakee Nathees
2be049f3fd try online page created 2022-04-06 02:33:21 +05:30
Thakee Nathees
ee2d87555a sources were refactored 2022-04-05 19:21:12 +05:30
Thakee Nathees
402f36f7e5
docs were fully refactored (#175) 2022-04-04 08:47:15 +05:30
Thakee Nathees
6e02e021bc
some comments were added (#169) 2022-03-30 23:43:18 +05:30
Thakee Nathees
89f8b77bb6
imported scripts were initialized (#158) 2021-07-02 21:32:30 +05:30
Thakee Nathees
273a31e588 native types initialization & attribute getters. (#147)
getters/setters native api functions added to the
vm's configurations and native types were initialized.
2021-06-29 00:30:41 +05:30
Thakee Nathees
a22c4cb90d
CLI argparse implementation. (#136)
* 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>
2021-06-24 23:08:44 +05:30
Thakee Nathees
000f4c4fe4
yet another docs update (#115) 2021-06-23 10:51:18 +05:30
Tiago Cavalcante Trindade
792d08eae7
Move fiber functions to module Fiber (#113) 2021-06-23 09:48:15 +05:30
Thakee Nathees
41ed7dd991 class implemented 2021-06-21 12:13:37 +05:30
Thakee Nathees
258b64948e yet another minor refactor 2021-06-20 15:53:21 +05:30
Thakee Nathees
4ba3ee2e28 __file__ added and some todos were completed 2021-06-20 09:29:26 +05:30
Ekin
22669bc226 changed the keyword in unit tests, prism and in the md 2021-06-16 11:14:35 +03:00
Alexander Patel
c58159b63d
Fix typos + rename variables (#73)
* fixed typos in src/

* fixed typos in docs/

* fixed typos in README and tests/

* rename INITALIZE to INITIALIZE

* rename PRIMITE to PRIMITIVE

* rename moudle to module

Co-authored-by: Alexander Patel <acpatel@andrew.cmu.edu>
2021-06-15 13:07:49 +05:30
Thakee Nathees
72e7522c12 operator andeq implemented 2021-06-14 21:50:07 +05:30
Thakee Nathees
d7f7c21081
Merge pull request #62 from ThakeeNathees/tco
Tail call optimization implemented
2021-06-13 21:58:36 +05:30
Thakee Nathees
6992f54ef3 Tail call optimization implemented 2021-06-13 21:57:54 +05:30
Derick Alangi
22be6af376 Add support for bitwise XOR, LSHIFT and RSHIFT operators (#63)
This commit addresses issue #54 in an attempt to add more bitwise
operators to pocketlang. Tests have also been written to verify that
the operators indeed works as expected.

To add, I also introduced a macro PK_RIGHT_OP that just aliases the
string "Right operand" which was already getting too hardcoded and
appearing too much in the pk_core.c file.
2021-06-13 20:27:48 +05:30
Thakee Nathees
9b2d28ef45 docs update after lang.disas 2021-06-13 11:03:18 +05:30
Thakee Nathees
17df5eb1e4 disassemble implemented 2021-06-12 16:34:10 +05:30
Thakee Nathees
749456e215 some (minor) code cleanups 2021-06-11 13:16:55 +05:30
Thakee Nathees
9fdab23a94 core attributes refactored and added tests 2021-06-10 23:12:04 +05:30
Thakee Nathees
49c1fec85f
REPL implementation. (#47) 2021-06-09 16:12:26 +05:30
Thakee Nathees
3092118008 Merge pull request #42 from ThakeeNathees/fiber-docs
fiber documentations
2021-06-07 07:20:06 +05:30
Thakee Nathees
3558a1994a fiber documentation written 2021-06-06 19:48:47 +05:30
Thakee Nathees
e1711b1c9d fiber implemented. 2021-06-06 03:10:58 +05:30
Thakee Nathees
284232c8c6 minor parser refactor for repl 2021-06-05 18:50:53 +05:30
Thakee Nathees
d74a06eacf Merge pull request #39 from ThakeeNathees/style-guide
some style guides were enforced.
2021-06-04 13:46:52 +05:30
Thakee Nathees
0bebeaafdf some style guides were enforcde.
- according to https://github.com/mcinglis/c-style
2021-06-04 13:26:50 +05:30
Thakee Nathees
f9bf0c1b9c more comments written throught out the source 2021-06-03 07:40:07 +05:30
Thakee Nathees
c9c0c56dbc Merge pull request #36 from ThakeeNathees/docs-improve
documentations updated
2021-06-02 09:24:28 +05:30
Thakee Nathees
3b36e9002e documentations updated 2021-06-02 09:13:56 +05:30
Thakee Nathees
45bcfc437c build docs implemented 2021-05-28 17:56:21 +05:30
Thakee Nathees
df93b2c1ec gc bugs fixed
- popping operands from the stack was too early -fixed
- some temproary string objects weren't pushed to the vm's temp root
  -fixed
- and some minor bug fixed
2021-05-23 23:25:04 +05:30
Thakee Nathees
994baea600 function name resolve implemented 2021-05-20 19:35:57 +05:30
Thakee Nathees
53ac9a6ae8 yet another import statement refactor 2021-05-19 18:56:36 +05:30
Thakee Nathees
41667eb218 relative import initial commit
parser and compiler are combined to just parser struct
2021-05-18 22:07:05 +05:30
Thakee Nathees
bd41435519 Merge pull request #22 from ThakeeNathees/chain-call-test
chain call implemented
2021-05-17 13:39:21 +05:30
Thakee Nathees
0c22a4d8e8 builtin function refactored.
- try now page won't crash anymore for core initialization.
2021-05-15 14:59:44 +05:30
Thakee Nathees
c3041c74a9 fixed: iterator (internal) variables popped twise.
printing stack trace implemented
2021-05-15 00:31:31 +05:30
Thakee Nathees
9c77ff5a6c docs buildscript updated 2021-05-14 15:14:39 +05:30