* Implement proper number literal parsing
- Scientific notation support
- Correct error handling in cases of invalid digits present in binary or
hex literals (0b123, 0x013FK).
* Fix style linter issues
* Support +/- in number literal exponent, add tests
- Add tests for scientific notation number literal parsing
- Add support for +/- in scientific notation exponents
Currently, it is required for the shell's working directory to be in
the repo's test/ directory in order for the tests to run correctly.
This also applies for the static analysis checker.
The reason for this is that paths in the test orchestration code are
defined relative to the test directory. Instead, and since none of
these scripts are modules that will in the forseeable future be
imported into other files, we update all paths to be relative
to the absolute path of the script's file itself.
┏( ͡❛ ͜ʖ ͡❛)┛
This commit implements list addition. A new list is allocated, and
the contents of l1 and l2 are concatenated onto the list.
This is done by extending the buffer template macro to support a
`concat` operation, which given an `other` buffer, appends all
elements of the `other` buffer to the end of the `self` buffer.
Allocations are done as needed.
We implement this additional operation, since the alternative would
be to call `reserve()` for each `write()` operation, which doesn't
seem ideal.
Issue: #55
* 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>
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.
* 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
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 ]