The primary purpose of this change is to disambiguate between
`else if` and `else \n if`.
Even though it's a breaking change, since it's at the very early
state we're allowed to make such breaking syntax change.
lang.write function moved to io and io.stdin, io.stdout, io.stderr
added for future streamed io operations
io.File read, write, open, close, getline, seek, tell implemented
str * int multiplication implemented
- ByteBuffer, and Vector classes were created. However thier methods are
limited, and to do.
- Strings supports new line escape "\\n".
- typename will return class name of an instance (was just 'Inst' fixed)
- _repr() method added. if _str method doesn' exists on an instance,
it'll try to call _repr() to make a string.
- number.isint(), number.isbyte() method added
- [], []= operator were added.
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:)
* 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
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
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