diff --git a/.gitignore b/.gitignore index 5f3d1e5..fe550ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ # build artifacts build/ -milly +inf reference_parser diff --git a/Makefile b/Makefile index 693ee21..29fd96f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ obj_dir = build object_paths = $(addprefix $(obj_dir)/, $(objects)) -milly: $(object_paths) +inf: $(object_paths) $(CC) -o $@ $(CFLAGS) $(object_paths) $(obj_dir)/%.o: src/%.c include/*.h | $(obj_dir) @@ -26,7 +26,7 @@ $(obj_dir): mkdir -p $(obj_dir) clean: - rm -f milly + rm -f inf rm -f reference_parser rm -r $(obj_dir) diff --git a/README.md b/README.md index c9a2bf6..a65b688 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# milly +# inf -milly is an hobby, and should not be taken seriously. +inf is an hobby, and should not be taken seriously. Interpreter for a Minimal ML-like language whose ideal goal is to be used for bootstrapping compilers and interpreters. ## How to build -milly's interpreter is written in portable ISO C11, sources are in `src/` and header files are in `include/`. +inf's interpreter is written in portable ISO C11, sources are in `src/` and header files are in `include/`. If your system happens to have a `make` implementation compatible with **GNU Make**, you can just run: @@ -14,11 +14,11 @@ If your system happens to have a `make` implementation compatible with **GNU Mak Otherwise, something like this should work: -> $(CC) -std=c11 -o milly -Iinclude/ src/*.c +> $(CC) -std=c11 -o inf -Iinclude/ src/*.c ## The language -milly is a minimal dialect of Standard ML and Haskell, +inf is a minimal dialect of Standard ML and Haskell, here is a list of the features (or better, limitations) I want to introduce: - Keep the implementation <5000 LOC @@ -34,9 +34,9 @@ here is a list of the features (or better, limitations) I want to introduce: - Delimited continuations (this is an overkill) - Easy syntax allowing easy kakoune support -milly's full grammar is specified as a pair of lex and yacc files in `ref_parser/`. +inf's full grammar is specified as a pair of lex and yacc files in `ref_parser/`. -kakoune plugin for milly is in `extra/milly.kak`. +kakoune plugin for inf is in `extra/inf.kak`. Here is a small example of the syntax: diff --git a/extra/inf.kak b/extra/inf.kak new file mode 100644 index 0000000..aeb1ca8 --- /dev/null +++ b/extra/inf.kak @@ -0,0 +1,49 @@ +# Detection +hook global BufCreate .*\.(mil) %{ + set-option buffer filetype inf +} + +hook global WinSetOption filetype=inf %{ + require-module inf + +} + +hook -group inf-highlighter global WinSetOption filetype=inf %{ + add-highlighter window/inf ref inf + hook -once -always window WinSetOption filetype=.* %{ + remove-highlighter window/inf + } +} + +provide-module inf %§ + +# Highlighters & Completion + +add-highlighter shared/inf regions +add-highlighter shared/inf/code default-region group +add-highlighter shared/inf/comment region (^|\h)\K# $ fill comment +add-highlighter shared/inf/double_string region -recurse %{(? diff --git a/src/main.c b/src/main.c index e0c2ed6..1497fc6 100644 --- a/src/main.c +++ b/src/main.c @@ -3,7 +3,7 @@ int main(int argc, char *argv[]) { if (argc != 2) { - printf("Usage: milly file.mil\n"); + printf("Usage: %s file.mil\n", argv[0]); return 1; } FILE *input = fopen(argv[1], "r");