Commit Graph

296 Commits

Author SHA1 Message Date
Rohan Sharma
3f6209f20d
doc: add a better phrase to credit wren (#146) 2021-06-26 21:31:47 +05:30
Derick Alangi
44f836bf69
Fix gcc warning thrown to STDOUT about argv qualifier (#144)
Fix gcc warning 'char **' to parameter of type 'const char **' as
the library requires a 'const char**' instead of 'char**'.
2021-06-26 18:44:26 +05:30
Derick Alangi
e74e209b7c
Add support for hyperbolic & arc trigonometric functions (#126)
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.
2021-06-26 18:13:29 +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
a6b20787f8 benchmarks - files validated and ordered 2021-06-24 17:33:17 +05:30
Derick Alangi
c1cde4c69b
Yet another fix of typos (#128) 2021-06-24 16:47:54 +05:30
Derick Alangi
273fbafa09
Add IS_NUM_BYTE validator to check if number is a byte (#127)
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.
2021-06-24 16:47:30 +05:30
Luke Edwards
6ce5c9f57e
fix(bench): do not double-reverse in list.js file (#133) 2021-06-24 11:43:17 +05:30
Luke Edwards
aba0546c2a
chore(bench): add lua benchmarks (#135) 2021-06-24 11:42:32 +05:30
Thakee Nathees
beaff939bb benchmarks script refactored (#134) 2021-06-24 11:16:51 +05:30
Luke Edwards
07321cc660
chore: include nodejs benchmarks (#125)
* chore: include nodejs benchmarks;

- Related #124

* chore: fix `factors.js` typo
2021-06-23 23:17:08 +05:30
Derick Alangi
5927d2cc8f
.DS_Store is usually from macOS & .idea/ is IntelliJ products (#123) 2021-06-23 22:21:24 +05:30
Jordan Ellis Coppard
39c5fba9d9
add elem in map (#121) 2021-06-23 21:03:26 +05:30
Tiago Cavalcante Trindade
6d434db0cb
Add <<= and >>= operators (#119)
* Add <<= and >>=
2021-06-23 19:54:20 +05:30
Thakee Nathees
64bf27674a
in test (ie. elem in container) implemented. (#117)
in keyword will invoke varContains(), the for now the list contains
implemented.
2021-06-23 15:51:59 +05:30
Thakee Nathees
000f4c4fe4
yet another docs update (#115) 2021-06-23 10:51:18 +05:30
Dmitry Guzeev
dbdb43b8ed
Number literal parsing (#106)
* 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
2021-06-23 10:30:06 +05:30
Derick Alangi
28cdd564d3
Fix minor typos in test files (#114) 2021-06-23 09:51:58 +05:30
Tiago Cavalcante Trindade
792d08eae7
Move fiber functions to module Fiber (#113) 2021-06-23 09:48:15 +05:30
Tiago Cavalcante Trindade
fe45ba3485
Numeric literal starts with decimal point implementation (Fix: #97) 2021-06-23 00:51:19 +05:30
Takashi Idobe
c0f00f6cae
add modeq implementation (#108)
* add modeq implementation

* code review feedback
2021-06-22 17:49:52 +05:30
Thakee Nathees
e177f80410
Merge pull request #107 from Timwi/patch-1
Typo fix
2021-06-22 16:25:54 +05:30
Timwi
7af71640d6
Typo fix 2021-06-22 12:44:05 +02:00
Thakee Nathees
024d673b25
Merge pull request #102 from ThakeeNathees/native-type
Native types & File object implementations.
2021-06-22 15:35:04 +05:30
Thakee Nathees
2b4d3af0a2
Merge pull request #104 from ntnlabs/patch-2
Update README.md
2021-06-22 13:36:25 +05:30
Thakee Nathees
600f972927 Native types & File object implementations. 2021-06-22 13:31:21 +05:30
NTN Labs
3295f0f9de
Update README.md
some language changes
2021-06-22 10:01:06 +02:00
Thakee Nathees
a21bd98945
Merge pull request #101 from ThakeeNathees/type
class implemented
2021-06-21 14:27:18 +05:30
Thakee Nathees
41ed7dd991 class implemented 2021-06-21 12:13:37 +05:30
Thakee Nathees
3f1d0e9380
Merge pull request #100 from ThakeeNathees/minor-refactors
yet another minor refactor
2021-06-20 16:01:02 +05:30
Thakee Nathees
258b64948e yet another minor refactor 2021-06-20 15:53:21 +05:30
Thakee Nathees
19e8733b9c
Merge pull request #98 from ThakeeNathees/some-todos
__file__ variable added to scripts
2021-06-20 10:02:36 +05:30
Thakee Nathees
4ba3ee2e28 __file__ added and some todos were completed 2021-06-20 09:29:26 +05:30
Thakee Nathees
733f006b03
Merge pull request #95 from ThakeeNathees/pk_doc
[WIP] Docstring extracted and `help()` function added
2021-06-18 15:45:19 +05:30
Thakee Nathees
e1628f1a73 docstring for pocket functions implemented 2021-06-18 14:52:24 +05:30
Thakee Nathees
af55fe6811
Merge pull request #86 from xSavitar/bitwise-not
Add support for bitwise NOT (~) operator to pocketlang
2021-06-17 18:29:46 +05:30
Derick Alangi
fbcf6fc1a1 use PEEK() so we don't loose reference 2021-06-17 13:43:09 +01:00
Derick Alangi
ac1d825f13 Add support for bitwise NOT (~) operator to pocketlang
Like other bitwise operators like: &, ^, >>, << etc, add support
for the bitwise NOT (~) operator.
2021-06-17 13:40:56 +01:00
Thakee Nathees
2e7ede104d
Merge pull request #91 from ThakeeNathees/scons-removed
SConstruct file removed and build scripts refactored
2021-06-17 16:17:59 +05:30
Thakee Nathees
f3fa3a61d3 scons script removed and build scripts refactored 2021-06-17 16:13:47 +05:30
Thakee Nathees
dc13ee01d3
Merge pull request #90 from alexcpatel/makefile-compile-objects
Makefile: compile objects individually, then link
2021-06-17 15:47:02 +05:30
Alexander Patel
90f95391b3 Makefile: compile objects individually, then link
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
2021-06-17 00:56:09 -07:00
Thakee Nathees
1e6fd9de5e
Merge pull request #87 from ThakeeNathees/minor-refactors
Renamed GC functions rename for documenting.
2021-06-17 01:13:14 +05:30
Thakee Nathees
d0229a9744 minor refactors for internal documenting. 2021-06-17 01:05:37 +05:30
Thakee Nathees
2b92758b83
Merge pull request #83 from xSavitar/fix-issue-79
Improve REPL to use a byte buffer with `fgetc()` to read line
2021-06-16 17:30:16 +05:30
Derick Alangi
c7a6bdec49 Improve REPL to use a byte buffer with fgetc() to read line
Introduced a new function `readLine()` that utilizes the byte buffer
together with `fgetc()` to read input from the STDIN. This enables
the REPL to read characters one at a time for validation & in a
safer manner where the buffer gets to be resized if it's full.
2021-06-16 12:14:23 +01:00
Thakee Nathees
d8f1ee8fe3
Merge pull request #75 from ekinbarut/master
Changed the elif notation to else if
2021-06-16 14:04:34 +05:30
Ekin
22669bc226 changed the keyword in unit tests, prism and in the md 2021-06-16 11:14:35 +03:00
Thakee Nathees
8bfe0930c5
Merge pull request #82 from alexcpatel/add-alexcpatel-author
AUTHORS: add alexcpatel to authors
2021-06-16 10:42:08 +05:30
Thakee Nathees
1d8cd13d4e
Merge pull request #81 from alexcpatel/tests-from-anywhere
tests: allow tests to be called from anywhere
2021-06-16 10:40:42 +05:30