From 6a5991fcf576908fb2bec8ac0bdee2e9ff1f5910 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Sat, 23 Jan 2021 20:00:36 +0900 Subject: [PATCH] kuroko: more upstream updates --- Makefile | 7 ++++--- apps/highlight-source.krk | 11 +++++++++++ kuroko | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 apps/highlight-source.krk diff --git a/Makefile b/Makefile index a51db535..507a1f69 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,8 @@ LIBS_Y=$(foreach lib,$(LIBS),.make/$(lib).lmak) SOURCE_FILES = $(wildcard kernel/*.c kernel/*/*.c kernel/*/*/*.c modules/*.c) SOURCE_FILES += $(wildcard apps/*.c linker/*.c libc/*.c libc/*/*.c lib/*.c) -tags: $(SOURCE_FILES) - ctags -f tags $(SOURCE_FILES) +tags: $(SOURCE_FILES) $(wildcard kuroko/src/*.c kuroko/src/*.h) + ctags -f tags $(SOURCE_FILES) $(wildcard kuroko/src/*.c kuroko/src/*.h) ## # Files that must be present in the ramdisk (apps, libraries) @@ -203,11 +203,12 @@ kuroko/%.o: kuroko/%.c KUROKO_CMODS=$(patsubst kuroko/src/module_%.c,%,$(wildcard kuroko/src/module_*.c)) $(patsubst lib/kuroko/%.c,%,$(wildcard lib/kuroko/*.c)) KUROKO_CMODS_X=$(foreach lib,$(KUROKO_CMODS),base/usr/local/lib/kuroko/$(lib).so) KUROKO_CMODS_Y=$(foreach lib,$(KUROKO_CMODS),.make/$(lib).kmak) -KUROKO_KRK_MODS=$(patsubst kuroko/modules/%.krk,base/usr/local/lib/kuroko/%.krk,$(wildcard kuroko/modules/*.krk)) +KUROKO_KRK_MODS=$(patsubst kuroko/modules/%.krk,base/usr/local/lib/kuroko/%.krk,$(wildcard kuroko/modules/*.krk kuroko/modules/*/*.krk)) KUROKO_FILES=$(KUROKO_CMODS_X) $(KUROKO_KRK_MODS) base/lib/libkuroko.so base/usr/local/lib/kuroko/%.krk: kuroko/modules/%.krk + @mkdir -p `dirname $@` cp $< $@ .make/%.kmak: kuroko/src/module_%.c util/auto-dep.py | dirs diff --git a/apps/highlight-source.krk b/apps/highlight-source.krk new file mode 100755 index 00000000..77edb26a --- /dev/null +++ b/apps/highlight-source.krk @@ -0,0 +1,11 @@ +#!/bin/kuroko +import fileio, syntax.highlighter, kuroko + +let code +with fileio.open(kuroko.argv[-1]) as f: + code = f.read() + +let highlighter = syntax.highlighter.KurokoHighlighter(code) + +highlighter.highlight() +syntax.highlighter.toTerminal(highlighter.process()) diff --git a/kuroko b/kuroko index 3e906150..50e49021 160000 --- a/kuroko +++ b/kuroko @@ -1 +1 @@ -Subproject commit 3e9061502108a80c4873a4d8dcff5e97ef55e538 +Subproject commit 50e490217070f9dbe085bc57637b12085b14b713