This function takes in 3 arguments: the string, the position and the
length (of the substring). As a quick example, a call to the function
`str_sub('c programming', 3, 11)`
will return the string 'programming' as the substring to the string
that is provisioned to the function call.
Functions added are: `sinh(x)`, `cosh(x)`, `tanh(x)`, `asin(x)`,
`acos(x)`, and `atan(x)`.
In addition, basic tests added in core.pk for these functions.
* 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>
In conjunction with the ASCII char set, a byte should be any valid
character mapping to an integer between -128 to 127 (that is signed
integers as well).
Anything beyond can't fit into a byte hence this can't be a character
but 2 characters.
* 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 updates the Makefile to complile each .c source file into
an object before linking. The benefit of this is that only the necessary
files will be recompiled when modifying the code.
We also move the Makefile and build.bat up to the root directory of the
repo. This is so that calling make directly builds the binaries.
Both files are updated to adapt to the new directory structure.
With this change, initial build times are increased from ~3s to ~10s on
my machine. However, subsequent build times are improved.
As a result of this change, SConstruct is somewhat deprecated. We can
update this as well if necessary in a future change.
I verified that the build completes successfully and tests pass for
both ubuntu and windows 10.
A future change could compile src/ files into a static library to be
linked with cli/, if necessary.
Issue: #64