Skip to content

Commit

Permalink
Merge pull request #212 from wrapl/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
rajamukherji authored Aug 28, 2024
2 parents 83e6d43 + cf8fa2d commit 774e3eb
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 30 deletions.
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@ minilang/lib/libminilang.a: minilang/Makefile minilang/src/*.c minilang/src/*.h
radb/libradb.a: radb/Makefile radb/*.c radb/*.h
$(MAKE) -C radb PLATFORM=$(PLATFORM) libradb.a RADB_MEM=GC

obj/%_init.c: src/%.c | obj src/*.h
echo "" > $@
cc -E -P -DGENERATE_INIT $(CFLAGS) $< | sed -f sed.txt | grep -o 'INIT_CODE .*);' | sed 's/INIT_CODE //g' > $@.tmp
mv $@.tmp $@

obj/rabs.o: obj/rabs_init.c src/*.h
obj/context.o: obj/context_init.c src/*.h
obj/target.o: obj/target_init.c src/*.h
obj/target_expr.o: obj/target_expr_init.c src/*.h
obj/target_file.o: obj/target_file_init.c src/*.h
obj/target_scan.o: obj/target_scan_init.c src/*.h
obj/target_meta.o: obj/target_meta_init.c src/*.h
obj/target_symb.o: obj/target_symb_init.c src/*.h
obj/targetset.o: obj/targetset_init.c src/*.h
obj/library.o: obj/library_init.c src/*.h
obj/%_init.done: src/%.c | obj src/*.h
echo "" > obj/$*_init.c
cc -E -P -DGENERATE_INIT $(CFLAGS) $< | sed -f sed.txt | grep -o 'INIT_CODE .*);' | sed 's/INIT_CODE //g' > obj/$*_init.tmp
mv obj/$*_init.tmp obj/$*_init.c
touch obj/$*_init.done

obj/rabs.o: obj/rabs_init.done src/*.h
obj/context.o: obj/context_init.done src/*.h
obj/target.o: obj/target_init.done src/*.h
obj/target_expr.o: obj/target_expr_init.done src/*.h
obj/target_file.o: obj/target_file_init.done src/*.h
obj/target_scan.o: obj/target_scan_init.done src/*.h
obj/target_meta.o: obj/target_meta_init.done src/*.h
obj/target_symb.o: obj/target_symb_init.done src/*.h
obj/targetset.o: obj/targetset_init.done src/*.h
obj/library.o: obj/library_init.done src/*.h

objects = \
obj/cache.o \
Expand Down
6 changes: 4 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rabs (2.31.0) UNRELEASED; urgency=medium
rabs (2.32.0) UNRELEASED; urgency=medium

* Updates.
* Updates.
Expand Down Expand Up @@ -66,5 +66,7 @@ rabs (2.31.0) UNRELEASED; urgency=medium
* Updates.
* Updates.
* Updates.
* Updates.
* Updates.

-- Raja Mukherji <raja@hinano> Wed, 31 Jul 2024 08:38:18 +0100
-- Raja Mukherji <raja@hinano> Wed, 28 Aug 2024 21:16:10 +0100
16 changes: 8 additions & 8 deletions docs/_util/minilang.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ class MinilangLexer(RegexLexer):
(r'-?\.[0-9]+((e|E)-?[0-9]+)?', Number),
('\"', String, 'string'),
('\'', String, 'string2'),
('\(', Operator, 'brackets'),
('\{', Operator, 'braces'),
(r'\(', Operator, 'brackets'),
(r'\{', Operator, 'braces'),
(r'::[A-Za-z_][A-Za-z0-9_]*', Name.Attribute),
(r':[A-Za-z_][A-Za-z0-9_]*', Name.Function),
(':\"', Name.Function, 'method'),
(r':>.*\n', Comment),
(':<', Comment.Multiline, 'comment'),
(r'\s+', Text),
(r'[A-Za-z_]\w*', Text),
(r'[A-Za-z_](\w|[₊₋₌₍₎⁰¹²³⁴⁵⁶⁷⁸⁹₀₁₂₃₄₅₆₇₈₉])*', Text),
(':=', Operator),
(',', Operator),
(';', Operator),
(':', Operator),
(']', Operator),
('\[', Operator),
(r'\]', Operator),
(r'\[', Operator),
(r'[!@#$%^&*+=|\\~`/?<>.-]+', Operator)
],
'string': [
Expand All @@ -62,7 +62,7 @@ class MinilangLexer(RegexLexer):
'string2': [
('\'', String, '#pop'),
(r'\\.', String.Escape),
('{', Operator, 'braces'),
(r'\{', Operator, 'braces'),
(r'.', String)
],
'method': [
Expand All @@ -71,11 +71,11 @@ class MinilangLexer(RegexLexer):
(r'.', Name.Function)
],
'braces': [
('}', Operator, '#pop'),
(r'\}', Operator, '#pop'),
include('root')
],
'brackets': [
('\)', Operator, '#pop'),
(r'\)', Operator, '#pop'),
include('root')
],
'comment': [
Expand Down
4 changes: 4 additions & 0 deletions docs/library/target.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ target
Sets the build function for :mini:`Target` to :mini:`Function` and returns :mini:`Target`. The current context is also captured.


:mini:`meth (Target: target):cached_depends: targetset`
Returns the set of dependencies of :mini:`Target`.


:mini:`meth (Target: target):context: context | nil`
Returns the build context of :mini:`Target` if one has been set, otherwise returns :mini:`nil`.

Expand Down
2 changes: 1 addition & 1 deletion minilang
Submodule minilang updated 140 files
6 changes: 3 additions & 3 deletions src/rabs.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ static ml_value_t *load_file(const char *FileName) {

load_file_state_t State[1];
State->Base.run = (void *)load_file_loaded;
State->Base.Context = &MLRootContext;
State->Base.Context = MLRootContext;
State->Result = MLNil;
mlc_expr_t *Expr = ml_accept_file(Preprocessor->Parser);
const mlc_expr_t *Expr = ml_accept_file(Preprocessor->Parser);
if (!Expr) {
return ml_parser_value(Preprocessor->Parser) ?: ml_error("FileError", "Error loading file %s", FileName);
}
Expand Down Expand Up @@ -1117,7 +1117,7 @@ int main(int Argc, char **Argv) {
}
if (InteractiveMode) {
target_interactive_start(NumThreads);
ml_console(&MLRootContext, rabs_ml_global, Globals, "--> ", "... ");
ml_console(MLRootContext, rabs_ml_global, Globals, "--> ", "... ");
} else if (WatchMode) {
#ifdef Linux
targetwatch_wait(restart);
Expand Down
2 changes: 1 addition & 1 deletion src/rabs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern __thread target_t *CurrentTarget;
ml_value_t *rabs_global(const char *Name);
ml_value_t *rabs_ml_global(void *Data, const char *Name, const char *Source, int Line, int Mode);

#define CURRENT_VERSION 2, 31, 0
#define CURRENT_VERSION 2, 32, 0
#define MINIMAL_VERSION 2, 10, 0

#endif

0 comments on commit 774e3eb

Please sign in to comment.