diff --git a/derived/interpret b/derived/interpret index 07eb8ac..68c211f 100644 --- a/derived/interpret +++ b/derived/interpret @@ -1 +1 @@ -../../journal/ +../../../Documents/journal/ diff --git a/src/scan.h b/src/scan.h index 00a4dcd..262a3d1 100644 --- a/src/scan.h +++ b/src/scan.h @@ -147,7 +147,7 @@ struct scan { } edits; struct linepair_tree dreams; struct linekvpair_tree contacts, books, tvs, movies, ideas, - vaccines, medications, mails, couches; + vaccines, medications, labs, mails, couches; struct linekvdate_tree froms; struct linekvmoney_tree taxes, incomes; struct glider_tree gliders; diff --git a/src/scan.re.c b/src/scan.re.c index 6dfa33b..bc613af 100644 --- a/src/scan.re.c +++ b/src/scan.re.c @@ -256,6 +256,7 @@ static int scan_day(struct scan *const scan, union date32 date, "idea: " :=> idea "vaccine: " :=> vaccine "medication: " :=> medication + "lab: " :=> lab "tax: " :=> tax "in: " :=> income "mail: " :=> mail @@ -436,6 +437,22 @@ static int scan_day(struct scan *const scan, union date32 date, continue; } + * { fail = "lab unrecognized"; goto catch; } + @s0 bralabel @s1 "]" => input_text { + const union line64 key = { { (uint32_t)line, date } }; + struct kvpair *pair; + switch(linekvpair_tree_bulk_assign(&scan->labs, key, &pair)) { + case TREE_PRESENT: fail = "duplicate"; case TREE_ERROR: goto catch; + case TREE_ABSENT: break; + } + pair->key.a = s0, pair->key.b = s1; + pair->value.a = pair->value.b = 0; + input.future = yycnewline, input.pair = &pair->value; + fprintf(stderr, "%s:%zu: new lab <<%.*s>>.\n", + datestr, line, (int)(s1 - s0), s0); + continue; + } + * { fail = "tax unrecognized"; goto catch; } @s0 bralabel @s1 "]" => input_money { const union line64 key = { { (uint32_t)line, date } }; @@ -989,6 +1006,7 @@ void scan_(struct scan *const scan) { linekvmoney_tree_(&scan->taxes); linekvdate_tree_(&scan->froms); linekvpair_tree_(&scan->couches); + linekvpair_tree_(&scan->labs); linekvpair_tree_(&scan->medications); linekvpair_tree_(&scan->vaccines); linekvpair_tree_(&scan->ideas); @@ -1070,6 +1088,7 @@ struct scan scan(struct journal *const jrnl) { || !linekvpair_tree_bulk_finish(&scan.ideas) || !linekvpair_tree_bulk_finish(&scan.vaccines) || !linekvpair_tree_bulk_finish(&scan.medications) + || !linekvpair_tree_bulk_finish(&scan.labs) || !linekvpair_tree_bulk_finish(&scan.couches) || !linekvdate_tree_bulk_finish(&scan.froms) || !linekvmoney_tree_bulk_finish(&scan.taxes) diff --git a/time.txt b/time.txt new file mode 100644 index 0000000..c381579 --- /dev/null +++ b/time.txt @@ -0,0 +1,3 @@ +set xdata time +set timefmt myTimeFmt +set xrange ['2000-01-01':*]