From 3fa27d49be472c28d0c4eaed776804e39c7f8bee Mon Sep 17 00:00:00 2001 From: eudoxia Date: Mon, 2 May 2022 12:23:42 -0400 Subject: section searching iterates forwards --- data.lp | 1 - doc/data.html | 1 - doc/freestanding/data.html | 1 - doc/usage.md | 3 +-- src/data.zig | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/data.lp b/data.lp index 8b362ae..a65daf6 100644 --- a/data.lp +++ b/data.lp @@ -202,7 +202,6 @@ fn search(list: []Section, name: []const u8) !usize { log(.err, "section '{s}' not found", .{name}); return error.NotFound; } -// TODO return last match instead? @. ## Parsing diff --git a/doc/data.html b/doc/data.html index 3453250..9fddef4 100755 --- a/doc/data.html +++ b/doc/data.html @@ -243,7 +243,6 @@ while (iterator.next()) |line| { log(.err, "section '{s}' not found", .{name}); return error.NotFound; } -// TODO return last match instead?

Parsing

diff --git a/doc/freestanding/data.html b/doc/freestanding/data.html index 63946cb..05bc7cf 100644 --- a/doc/freestanding/data.html +++ b/doc/freestanding/data.html @@ -255,7 +255,6 @@ while (iterator.next()) |line| { log(.err, "section '{s}' not found", .{name}); return error.NotFound; } -// TODO return last match instead?

Parsing

diff --git a/doc/usage.md b/doc/usage.md index 3a5bd0d..0cc9632 100755 --- a/doc/usage.md +++ b/doc/usage.md @@ -8,7 +8,7 @@ This tool consists of two programs, `tangle` and `weave`, both of which accept a ## Usage -These programs are intended to be intermediary text processing functions, used as components within build automation routines or shell scripts. The build processes for this tool itself, `build.sh` and `gen_freestanding.sh`, serve as example use cases. +These programs are intended to be intermediary text processing functions, used as components within build automation routines or shell scripts. The build processes for this tool itself, `build.sh` and `gen-freestanding.sh`, serve as example use cases. # Dependencies @@ -94,4 +94,3 @@ The source code of this tool is rendered as a set of literate program documents, # Future Work - The treatment of whitespace within formatting and configuration commands is currently rather strict, as no trimming of leading or trailing whitespace around the command contents is applied. This may be changed for the sake of convenience, at the expense of added parsing complexity. -- In a document with duplicate section names, references to such sections are resolved to the section with that name which appears first within the document. It may be more useful to have these resolve to the matching section which appears last in the document instead, which would permit some amount of name reuse. diff --git a/src/data.zig b/src/data.zig index b1a342c..0340a82 100644 --- a/src/data.zig +++ b/src/data.zig @@ -89,7 +89,6 @@ fn search(list: []Section, name: []const u8) !usize { log(.err, "section '{s}' not found", .{name}); return error.NotFound; } -// TODO return last match instead? const CommandType = enum { start, add, end, ref, none }; -- cgit v1.2.3