1
0
mirror of https://github.com/janet-lang/janet synced 2024-07-02 01:53:15 +00:00
Commit Graph

176 Commits

Author SHA1 Message Date
Calvin Rose
f74e19e673 Improve alt keys and at alt-f and alt-b to repl 2020-01-19 11:16:41 -06:00
Calvin Rose
da70807292 Make autocompletion more zsh like
Also add a few ctrl sequences from readline, and
ignore unknown ctrl sequences.

Address #264

Adds Ctrl-n, Ctrl-p, and Ctrl-w
Ignores unknown ctrl sequences
No alt-* sequences yet.
2020-01-19 10:38:35 -06:00
Calvin Rose
64b9482602 Make history not duplicate itself in getline. 2020-01-18 20:56:35 -06:00
Calvin Rose
65d7c3eed1 Use stderr for getline output instead of stdout. 2020-01-18 14:34:29 -06:00
Calvin Rose
772916593b Address #262
Pressing tab only does one thing at a time.
2020-01-18 09:44:59 -06:00
Calvin Rose
521a29446f Don't rely on obscure printf features.
They may not work on all platforms.
2020-01-18 00:27:40 -06:00
Calvin Rose
a8e4c4bed0 Add special forms and sort completions.
Also fix case when no completion is needed.
2020-01-18 00:17:08 -06:00
Calvin Rose
6471b4d100 Add preliminary repl completion via tab. 2020-01-17 23:03:50 -06:00
Calvin Rose
789c5f135a Add ctrl-a and ctrl-e to control line in repl
Emacs to start of line and to end of line key bindings.
2020-01-17 09:33:30 -06:00
Calvin Rose
65be9ae095 Add defer and assert to the core. 2020-01-15 22:39:14 -06:00
Calvin Rose
a68ee7aac6 Update Copyright 2020. 2020-01-12 10:50:37 -06:00
Calvin Rose
9cb25ad7b1 Remove some feature test macros.
_BSD_SOURCE is deprecated and not needed.
2019-12-30 21:30:13 -05:00
Calvin Rose
f361830cb2 Update feature test macro in line.c 2019-12-30 20:24:40 -05:00
Calvin Rose
bca0392738 First work on threading.
Posix only, needs to be disabled on windows. Also
the Makefile needs to be configurable, and meson.build
needs to take pthreads into account.
2019-11-26 23:13:53 -06:00
Jon Staab
134163708a Fix formatting 2019-11-16 16:07:15 -08:00
Jon Staab
40e6616df0 Add support for delete key in repl 2019-11-16 16:01:52 -08:00
Calvin Rose
c9292ef648 Use /MD on windows.
Just makes things easier. Assume machines have msvcrt.dll
on them. If not, we can add msvcrt.dll to the dist folder and add to
installer.
2019-11-09 16:05:07 -05:00
Calvin Rose
c5010dffb4 Print error message on bad CLI usage.
This was a small regression when bundling cli-main
into boot.janet.
2019-11-05 12:51:15 -06:00
Calvin Rose
280dca3998 Add shell.c to the amalgamation.
This allows easy builds of the full interpreter with no
build system.

  1. Get janet.c, janet.h, janetconf.h, and shell.c in a directory. Edit
     janetconf.h as desired.
  2. gcc shell.c janet.c -lm -ldl -O2 -o janet (on GNU-Linux for example)
  3. ./janet -h (Yay!)
2019-10-29 19:18:44 -05:00
Calvin Rose
427b2638e0 Fix startup environment. 2019-10-29 18:47:54 -05:00
Calvin Rose
0d16b9e1a1 Move init.janet into cli-main in boot.janet
This makes it easier to get the CLI functionality when
embedding Janet, although the main reason is the init script
is now pre-compiled to bytecode when generating the boot image.
2019-10-29 18:16:32 -05:00
Calvin Rose
45c2819068 Improve flychecking.
Flychecking will now work correctly with arity checking, and
will better handle imports. Well structured modules should interact
cleanly with the flychecker in a mostly safe manner, but maliciously
crafted modules can execute arbitrary code. As such, the flychecker is
not a good way to validate completely untrusted modules.

We also extend run-context with an :evaluator option to replace
:compile-only. This is more flexible and allows users to create their
own flychecker like functionality.
2019-10-27 16:15:41 -05:00
Calvin Rose
a18a251d16 Address some issues found in lgtm
Caught a few potentially issues with overflows, as well as use of
unsafe function localtime.
2019-10-10 22:59:43 -05:00
Calvin Rose
a8afc5b81f Sourcemapping uses line, column instead of offsets.
This should be friendlier to most users. It does, however, mean
we lose range information. However, range information could be
recovered by re-parsing, as janet's grammar is simple enough to do this.
2019-09-22 17:18:28 -05:00
Calvin Rose
060d11e4c2 Add Q and q formatters to buffer/format.
These are similar to P and p, but print values
on a single line for a much more compact version.
2019-08-24 22:53:45 -04:00
Calvin Rose
54170d92db Add some color to stacktraces in repl. 2019-08-12 19:20:01 -05:00
Calvin Rose
8bbe518696 Executables linking to natives working on linux.
This involves a bunch of machinery in cook.janet
and even a little bit in the janet C API.
2019-07-28 13:27:20 -05:00
Calvin Rose
7e97687c9e Update windows installation and automation. 2019-07-27 21:44:44 -04:00
Calvin Rose
a3a3e4c0dc Add (dyn :executable).
Also remove process/args.
2019-07-27 09:31:03 -05:00
Calvin Rose
a0e98b9aa8 Deprecate process/args and add use macro.
Use is a shorthand for (import module :prefix "").
process/args has been replaced by (dyn :args) at
the top level.
2019-07-20 16:57:07 -05:00
Calvin Rose
7c4670c3de Change semantics of -l flag to be more useful. 2019-07-04 12:42:54 -05:00
Calvin Rose
300124961f Change -c option to use dofile instead of require 2019-06-19 22:05:13 -04:00
Calvin Rose
9ba8728176 Update module system.
Add relative imports and path normalization. This should
help towards a more composable build/dependency system.
2019-06-18 22:10:13 -04:00
Calvin Rose
a5e50a0f65 Fix windows getline. 2019-06-18 00:04:29 -04:00
Adam Schwalm
3bbc121c6a Add support for getting more detailed parser state 2019-06-15 07:37:01 -05:00
Calvin Rose
802a2d6b71 Add more dynamic bindings for printing. 2019-06-08 15:27:13 -04:00
Calvin Rose
bea6dbbf3d Hint utf8 output on windows console. 2019-05-31 15:30:23 -04:00
Calvin Rose
db55277b58 Work on windows installer.
We will probably shift to NSIS as the default
installation method for windows. Shipping around a
single binary just doesn't cut it if we want to be able
to reliably use tools like `jpm` to build things.
2019-05-28 20:45:39 -04:00
Calvin Rose
ce9cd4fcef Issue #113 Color console support for windows 10
Use SetConsoleMode winapi function to enable ANSI
escape codes if we can.
2019-05-26 22:31:30 -04:00
Calvin Rose
97ad4c4f89 Update manpage and make -k mode not exit on error. 2019-05-19 15:20:59 -04:00
Adam Schwalm
f444bd25ef Add a 'compile-only' flag to the command line
This allows syntax checkers like the emacs 'flycheck-mode' to check
the source without side effects.
2019-05-19 12:55:28 -05:00
Calvin Rose
1cfc7b3b0d Add preliminary debugger to default repl.
Also upddate colors, and fix formatting.
2019-05-02 17:11:30 -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
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
a363dce943 Allow proper overriding of cfunctions in the core.
Allow overriding functions in the core libray to provide better
functionality on startup. Used to include our getline function in
the repl but use a simpler version in the core library.
2019-03-08 11:39:18 -05:00
Calvin Rose
9d4effc02e Add make format to format code.
A consistent style should help with contributors and
readability. We use astyle as the formatter as can make a pretty
good approximation of the current style and my preferred style.

Astyle can be found at http://astyle.sourceforge.net/astyle.html
2019-02-19 20:51:34 -05:00
Calvin Rose
ed72dcf82d Rename the header <janet/janet.h> to <janet.h>
Makes it easier to use and remember, and makes the
variable `module/*headerpath*` make more sense.
2019-02-18 20:13:35 -05:00
Calvin Rose
8d9a88e759 Add JANET_PATH back in. 2019-02-18 15:31:15 -05:00
Calvin Rose
6af5800d21 Add -m option to command line
The -m option set the default system path for finding libraries
for that invocation of Janet.
2019-02-18 15:11:59 -05:00
Calvin Rose
3b6ff3c09a Add -c option to main client
This allows compile janet source modules to images.
2019-02-16 21:55:53 -05:00
Calvin Rose
7ba925c50a Make getline more useful. 2019-01-31 12:34:22 -05:00
Calvin Rose
737b2449f0 Update highlight and the mainclient. 2019-01-20 10:05:51 -05:00
Calvin Rose
b84b0e4828 Expose more of the module system.
The system path can more easily modified at runtime,
and the module/cache and module/loading tables are now exposed.
Properly cache native modules as well.
2019-01-18 12:04:34 -05:00
Calvin Rose
84fb07dd5a Add quiet option to main client. 2019-01-10 17:10:12 -05:00
Calvin Rose
6f3bc3d577 Update copyright date, fix types, remove trailing whitespace. 2019-01-06 03:23:03 -05:00
Calvin Rose
338b31f5a2 Add janet_fixarity. Update emscripten source. 2019-01-05 20:45:24 -05:00
Calvin Rose
b60e3e302a Update C API to use friendlier functions rather than macros.
Error handling is implemented with setjmp/longjmp so code
can be more concise. This required a very large but straight forward refactor for all
of the libraries.
2019-01-05 20:09:03 -05:00
Calvin Rose
8dde89126e Fix -s flag in janet binary. 2018-12-30 18:23:29 -05:00
Calvin Rose
56927e1b81 Fix -e option. 2018-12-30 17:51:15 -05:00
Calvin Rose
2bcedd5920 Remove indexing with numeric constants from janet. 2018-12-28 23:44:39 -05:00
Calvin Rose
03dbd79165 Rename the := special form to set so it does not look like a keyword. 2018-12-16 21:57:32 -05:00
Calvin Rose
e8c0dcd14e Make source mapping use byte offset instead of line and col
for better debugging support in repl. Add debug module for better
debugging support.
2018-12-13 18:46:53 -05:00
Calvin Rose
6185af7227 Try to remove build issues on windows. 2018-12-08 17:20:24 -05:00
Calvin Rose
16e514b351 Update version schema - now have version number
and build number.
2018-12-08 14:17:03 -05:00
Calvin Rose
7668cd5772 Don't use generated headers for embedded janet
code, use object files.
2018-12-06 14:30:11 -05:00
Calvin Rose
4e4dd31164 Change syntax for namespaces.
Add quasiquote, unquote, and unquote-splicing
as specials rather than a macro.
2018-11-30 22:49:21 -05:00
Calvin Rose
25c50f5026 Fix repl default chunks. 2018-11-30 14:17:10 -05:00
Calvin Rose
d4ee760b3e Change format for declaring flexible arity functions. 2018-11-25 14:03:00 -05:00
Calvin Rose
4c4eff9390 Replace cast with type pun. 2018-11-18 14:17:50 -05:00
Calvin Rose
4d119e4e03 Begin adding more complete documentation. 2018-11-15 15:45:41 -05:00
Calvin Rose
2a127af1ca A few fixes to things like macro expand, etc. 2018-11-07 22:27:06 -05:00
Calvin Rose
853a839f6c Add git commit hash to build to get version. 2018-10-31 16:21:21 -04:00
Calvin Rose
98f2c6feab Add lookups for marshalling and unmarshalling.
Allow generating lookup tables from the current environment.
2018-10-21 01:35:07 -04:00
Calvin Rose
c1923c5ada Web assembly build with emscripten. 2018-10-16 23:08:26 -04:00
Calvin Rose
e963672977 Make the assembler optional during compilation. 2018-09-29 10:58:57 -04:00
Calvin Rose
c8ef2a0d88 Rename to janet 2018-09-05 22:18:42 -04:00
Calvin Rose
75c66ea6dd Refactor native module declarations. marshal can now
serialize entire environment.
2018-08-26 14:35:01 -04:00
Calvin Rose
84f2c84fb5 Fix tabs in repl. 2018-08-25 15:34:27 -04:00
Calvin Rose
510feeed7f Allow marshaling of more functions for core.
Fix indentation in some files.
2018-08-22 21:41:25 -04:00
Calvin Rose
d95941597f Fix help. 2018-08-15 22:48:35 -04:00
Calvin Rose
48c2654312 Local changes. 2018-08-07 00:54:47 -04:00
Calvin Rose
7a7291ac3a Remove extra code. 2018-08-03 21:51:35 -04:00
Calvin Rose
169a22f03e Fix init.dst, work on metabuild tool to make
native module creation easier
2018-08-03 21:50:32 -04:00
Calvin Rose
5b15ad9ff8 Try and fix os.clock on windows. 2018-07-08 20:54:41 -04:00
Calvin Rose
1f37919f39 Rename boot.dst to core.dst 2018-07-04 00:21:18 -04:00
Calvin Rose
a018f9f54a Major refactor. Move files around, merge compiler into
core and other changes, work on inlining many c functions.
2018-07-03 23:07:35 -04:00
Calvin Rose
e60c8a9b75 Update indentation in boot and init to be more like
most lisps.
2018-07-01 21:12:46 -04:00
Calvin Rose
5afde3f6d4 Add line numbers to repl like irb. 2018-06-29 13:01:23 -04:00
Calvin Rose
bb406133de New sourcemaps v1. 2018-06-28 23:37:04 -04:00
Calvin Rose
5e9d1d07b9 Better refresh after coming back from suspend. 2018-06-24 13:20:32 -04:00
Calvin Rose
ceff49a08d Enable suspending repl with ctrl-z. 2018-06-24 13:18:44 -04:00
bakpakin
1690fee446 Add failure on top level error. 2018-06-08 15:58:23 -04:00
Calvin Rose
8a346ec655 Add option to cli interface to stop scanning options. 2018-05-26 14:17:44 -04:00
Calvin Rose
68895e27d4 Change import semantics. Fix gc bug with fibers. 2018-05-18 20:53:19 -04:00
Calvin Rose
f295692b50 Update copyright to 2018. Add string methods. 2018-05-17 23:41:20 -04:00
Calvin Rose
6ac59251e9 Fix some very mild memory leaks in line.c and the do_bytes function (not
deiniting the parser).
2018-05-15 22:05:47 -04:00
Calvin Rose
c6f79eca6d Make setting up stl easier. Add shared library output to Makefile. 2018-05-14 21:52:51 -04:00
Calvin Rose
dafc121f4d Change c function macros to be explicitly non functional by
capitalizing them.
2018-05-12 20:31:28 -04:00
Calvin Rose
584c75b3f6 Update Makefile for faster builds. 2018-05-10 11:11:18 -04:00
Calvin Rose
932a0324ee More work on renaming functions. Change long string syntax to use
backticks. Allow custom masks in fibers for custom error and debug
handling.
2018-05-09 17:01:58 -04:00