Commit Graph

12 Commits

Author SHA1 Message Date
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
Alexander Patel
ae4d2971c1 operator oreq and xoreq implemented 2021-06-14 21:36:10 -07:00
Thakee Nathees
72e7522c12 operator andeq implemented 2021-06-14 21:50:07 +05:30
Thakee Nathees
558241a77b import name bind bug fix
stack curreption (due to stack missing parameters)
fixed, and some assertion macros added.
2021-06-14 09:55:18 +05:30
Thakee Nathees
e90763c878 Merge pull request #65 from xSavitar/attr-range-start-end
Add support for `.start` and `.end` attributes on Range objects
2021-06-13 22:30:16 +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
Derick Alangi
2707c1eec3
Fix #54: Add bitwise OR operator and make it available in PKVM (#59)
* Fix #54: Add bitwise OR operator and make it available in PKVM

Like the bitwise AND, this is an implementation for pocketlang to
support the bitwise OR operation. In addition, updated "value" ->
"result" in other operation to correctly reflect the container's
purpose. It's indeed the result after the operation, which is a value
too.

In addition, add tests for bitwise AND (&) and bitwise OR (|). Add a
print statement in test file with message that all tests passed with
no errors.

* Fix typo in comment

* Cleanup fixes
2021-06-13 09:43:05 +05:30
Thakee Nathees
17df5eb1e4 disassemble implemented 2021-06-12 16:34:10 +05:30
Derick Alangi
15716de9ce Fix #56: Implement the cos() and tan() math functions
I've also written tests in the corresponding test files, please have
a look. But on the command line (after compiling the source), do:

>>> from math import *
>>> print(cos(1))
[ results will be displayed here ]
>>> print(tan(1))
[ results will be displayed here ]
2021-06-11 18:14:20 +01:00
Thakee Nathees
9fdab23a94 core attributes refactored and added tests 2021-06-10 23:12:04 +05:30