1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-05 16:26:17 +00:00
Commit Graph

621 Commits

Author SHA1 Message Date
Calvin Rose
20e94adb61 Update documentation for update function. 2019-04-21 15:44:03 -04:00
Calvin Rose
9100794cea Drop leading and trailing newlines in longstrings.
Long, heredoc style strings can now have
a non semantic leading newline character. This makes it
easier to define large columns of text.
2019-04-21 13:34:41 -04:00
Calvin Rose
4ddf90e301 Make nanboxing on 64 bit platforms not the default.
64 bit nanboxing is kind of sketchy on non x86 architectures.
32 bit architectures seem to work better as the 32 implementation
doesn't rely on the format of the address space and layout of
double's in memory.
2019-04-18 12:52:28 -04:00
Calvin Rose
d1eca1cf52 Add all-dynamics to list current dynamic bindings. 2019-04-17 09:47:33 -04:00
Calvin Rose
7918add47d Allow dynamically setting output for printers
Some functions like print and debug/stacktrace print
to a file, usually stdout. This file can now be optionally set
via a dynamic variable.
2019-04-16 21:44:19 -04:00
Calvin Rose
513d551df6 Move print in source code to io module.
print now reads the dynamic binding for :out
when choosing where to write to.
2019-04-16 19:10:01 -04:00
Calvin Rose
ddaa5e34e6 Fix web versinon repl colors. 2019-04-16 16:06:52 -04:00
Calvin Rose
208eb7520a Update CHANGELOG.md and bump version. 2019-04-16 15:48:53 -04:00
Calvin Rose
2d7df6b78e Many changes for adding dynamic (fiber-level) scope.
- Allow passing a table to fibers, which make fiber level scope easier.
- Add fiber/getenv, fiber/setenv, dyn, and setdyn
- Remove meta, *env*, and *doc-width*
- Some functions changed dignatures, and no longer take an env
2019-04-16 15:41:45 -04:00
Calvin Rose
7527142549 Prepare for 0.4.1 release 2019-04-14 11:42:41 -04:00
Calvin Rose
4e6193b67e Fix parse insert bug. 2019-04-13 14:38:30 -04:00
Calvin Rose
1596511175 Fix undefined behavior bug with errors.
janet_vm_return_reg should only be set when janet_continue
is called. Otherwise, a panic may dump it's error message in
the wrong place, resulting in undefined behavior (often showing
the last return value or worse, segfaulting).
2019-04-10 23:29:40 -04:00
Calvin Rose
5287007cd6 Fix typo in comment. 2019-04-09 09:05:47 -04:00
Calvin Rose
e5a56174e2 Switch fexists to use os/stat when available.
When os/stat is not available, we first
try to read one byte from the file before
saying it is good. If that fails, it is not
a file that we can read from so it counts as not found.
2019-04-09 09:01:52 -04:00
Calvin Rose
6c68c7a35f Address issue #78
(file/open path :r+) should help. On windows, result
is unknown as of now.
2019-04-09 08:38:56 -04:00
Calvin Rose
675c1030fd Fix error message on an arity mismatch.
janet_call had a bad janet_printf.
2019-04-07 23:53:50 -04:00
Calvin Rose
ed65d04b81 Fix peg bug with arguments.
By holding on a reference to argv for a long time, we
may trigger a use after free bug if the stack is resized. In
janet c function, argv is only vvalid up until the next stack operation
on the fiber. We could say that this is the dynamic lifetime of
argv.

To fix this, we copy extra arguments into a tuple, which is properly
garbage collected.
2019-04-07 15:14:54 -04:00
Calvin Rose
fa1c5c85b5 Remove no-capture mode in pegs.
Some peg grammars could not capture values based on their position in a
larger grammar. This is a design limitation inheritted from LPeg, but no
longer needed as the replace mode is superseded by the accumulator mode,
which is more general if slightly harder to use.
2019-04-06 11:38:00 -04:00
Calvin Rose
ee35786c8f semicolon 2019-04-05 14:45:45 -04:00
Calvin Rose
ec6e2cfd62 os/stat returns nil if file does not exist. 2019-04-05 14:45:04 -04:00
Calvin Rose
7d48e7fd1f Remove some extra search paths. 2019-04-01 14:07:13 -04:00
Calvin Rose
0063e3a69d Fix module path typo. 2019-04-01 13:48:30 -04:00
Calvin Rose
cd6c009c03 Reformat and use new os/stat capabilities. 2019-04-01 11:21:45 -04:00
Calvin Rose
b15cf193a0 Update os/stat
os/stat can now take a keyword as the second argument
to avoid creating a table if one only wants on value
from stat.
2019-04-01 11:11:15 -04:00
Calvin Rose
e239980da7 Quasiquoting bracketed tuples. 2019-03-31 14:15:26 -04:00
Calvin Rose
1709bce77e Add os/rm and os/rmdir 2019-03-30 15:39:24 -04:00
Calvin Rose
d6ba2de888 Fix os/dir on windows. 2019-03-30 13:46:52 -04:00
Calvin Rose
61c0a4bc87 Windows has different defines for file modes. 2019-03-30 13:09:35 -04:00
Calvin Rose
8af28d3fa5 Windows bump. 2019-03-30 13:06:24 -04:00
Calvin Rose
970923d0e5 Update os/dir for windows. 2019-03-30 13:01:57 -04:00
Calvin Rose
5d7dc0a57c Add os/dir support for linux/posix. 2019-03-30 12:36:27 -04:00
Calvin Rose
c5090606a4 Add os/stat function.
Allows getting more information about files. This
is really useful for writing software that needs to inspect
the file system (like a static site generator). We still need
a way to iterate directories though.
2019-03-30 12:06:14 -04:00
Calvin Rose
bf2d9ae634 Mess with includes for os.c 2019-03-28 23:34:24 -04:00
Calvin Rose
53c7f2eedd Add more os module functions. 2019-03-28 23:23:58 -04:00
Calvin Rose
bfd3845218 Fix cfunction debugging issue
Cfunction were not describing themselves very well, as
their names were not be added to the registry.
2019-03-27 00:14:51 -04:00
J.-F. Cap
22d75d017f fix AbstractType get/set error message 2019-03-26 21:47:12 -04:00
Calvin Rose
082639319e Add colors to repl and string/format.
This makes the repl look nicer using ANSI
color codes, which are widely supported. The codes
can also be turned off via the -m flag.
2019-03-24 15:00:22 -04:00
Calvin Rose
2c9195b507 More updates to meson
Redo amalg script so we can more easily run
it from Meson.
2019-03-23 13:50:50 -04:00
Calvin Rose
7f1b5d4d70 Merge core.janet into boot.janet
This simplifies the build machinery a bit.
core.janet is never actually included in the final
binary, it is just used to generate an image file.
2019-03-22 18:34:50 -04:00
Calvin Rose
25aa7a26c5 Add experimental meson build.
Should help with IDE integration.
2019-03-22 18:07:10 -04:00
Calvin Rose
cb2caecbb3 Add janetconf.h for configuring builds.
Rather than edit the Makefile or the janet.h header yourself, use
janetconf.h to configure builds. This has the benefit of making it
easier to configure janet in a persitent but easy way.
2019-03-22 14:33:30 -04:00
Calvin Rose
94a2084723 Add tostring method for abstract types.
This lets abstract types customize how they
print for debugging.
2019-03-19 13:36:26 -04:00
Calvin Rose
22e24fb47b Remove some dead code in bigint. 2019-03-19 12:30:44 -04:00
Calvin Rose
93f0d5f626 Quiet appveyor warnings. 2019-03-18 22:00:20 -04:00
Calvin Rose
bad040665f Renamed bigint -> inttypes / int
A lot of refactoring larger integer types. Fix a number
of casting errors, but mostly rename things. Also try to
limit use of template-like macros as they bloat the binary
if not used in moderation. We were able to reduce the size of
typed array code as well by using a single view types.
2019-03-18 18:36:53 -07:00
J.-F. Cap
a07d76b264 use custom string to bigint reader in place of strtol
for better compatibility with default janet number reader
2019-03-18 18:36:53 -07:00
J.-F. Cap
1db6d0e0bc Trap INT64_MIN / -1 exception 2019-03-18 18:36:53 -07:00
J.-F. Cap
34849ea7b3 added (u)int64 typed arrays back 2019-03-18 18:36:53 -07:00
J.-F. Cap
5a9f7c3a85 added in place op! operators 2019-03-18 18:36:53 -07:00
J.-F. Cap
15c6300608 added bitwise operators and guard for division by zero 2019-03-18 18:36:53 -07:00