readme update

This commit is contained in:
2025-05-26 22:31:16 -04:00
parent 06a741ec34
commit b23045c9d3
2 changed files with 16 additions and 1 deletions

View File

@@ -104,7 +104,10 @@ typedef def_Slice(Byte);
void slice__copy(Slice_Byte dest, SSIZE dest_typewidth, Slice_Byte src, SSIZE src_typewidth);
#define slice_copy(dest, src) slice__copy( slice_byte(dest), size_of_slice_type(dest), slice_byte(src), size_of_slice_type(src))
#define slice_iter(container, iter) typeof((container).ptr) iter = (container).ptr; iter != ((container).ptr + (container).len); ++ iter
#define slice_iter(container, iter) \
typeof((container).ptr) iter = (container).ptr; \
iter != ((container).ptr + (container).len); \
++ iter
#define slice_arg_from_array(type, ...) & (tmpl(Slice,type)) { \
.ptr = farray_init(type, __VA_ARGS__), \

View File

@@ -3,3 +3,15 @@
An exercise on making the simplest useful parser with different languages or conventions.
The C code conveys a convention for doing C I've synthesized after studying how several people in the "handmade" community have written their exposed libraries or codebases.
The goal of the exercise is always the following:
```odin
start:
file_contents := file.read_contents(self.source)
tokens := watl.lex(file_contents)
str_cache := str.cache.init()
lines := watl.parse(tokens)
listing := watl.dump_listing(lines)
file.write_str(str_fmt("<name>.listing.source", self.source.name))
end
```