couch
This commit is contained in:
parent
cb6e0ebab4
commit
66a3c1752f
|
@ -141,7 +141,7 @@ struct scan {
|
||||||
} edits;
|
} edits;
|
||||||
struct linepair_tree dreams;
|
struct linepair_tree dreams;
|
||||||
struct linekvpair_tree contacts, books, tvs, movies, ideas,
|
struct linekvpair_tree contacts, books, tvs, movies, ideas,
|
||||||
vaccines, medications;
|
vaccines, medications, mails, couches;
|
||||||
struct linekvmoney_tree taxes, incomes;
|
struct linekvmoney_tree taxes, incomes;
|
||||||
struct glider_tree gliders;
|
struct glider_tree gliders;
|
||||||
struct flight_tree flights;
|
struct flight_tree flights;
|
||||||
|
|
|
@ -245,6 +245,7 @@ static int scan_day(struct scan *const scan, union date32 date,
|
||||||
<bracket> "tax: " :=> tax
|
<bracket> "tax: " :=> tax
|
||||||
<bracket> "in: " :=> income
|
<bracket> "in: " :=> income
|
||||||
<bracket> "mail: " :=> mail
|
<bracket> "mail: " :=> mail
|
||||||
|
<bracket> "couch: " :=> couch
|
||||||
|
|
||||||
<line> "- " => input_text {
|
<line> "- " => input_text {
|
||||||
const union line64 key = { { (uint32_t)line, date } };
|
const union line64 key = { { (uint32_t)line, date } };
|
||||||
|
@ -441,14 +442,14 @@ static int scan_day(struct scan *const scan, union date32 date,
|
||||||
<income> @s0 bralabel @s1 "]" => input_money {
|
<income> @s0 bralabel @s1 "]" => input_money {
|
||||||
const union line64 key = { { (uint32_t)line, date } };
|
const union line64 key = { { (uint32_t)line, date } };
|
||||||
struct kvmoney *pair;
|
struct kvmoney *pair;
|
||||||
switch(linekvmoney_tree_bulk_assign(&scan->taxes, key, &pair)) {
|
switch(linekvmoney_tree_bulk_assign(&scan->incomes, key, &pair)) {
|
||||||
case TREE_PRESENT: fail = "duplicate"; case TREE_ERROR: goto catch;
|
case TREE_PRESENT: fail = "duplicate"; case TREE_ERROR: goto catch;
|
||||||
case TREE_ABSENT: break;
|
case TREE_ABSENT: break;
|
||||||
}
|
}
|
||||||
pair->key.a = s0, pair->key.b = s1;
|
pair->key.a = s0, pair->key.b = s1;
|
||||||
pair->value = (struct money){0, CAD};
|
pair->value = (struct money){0, CAD};
|
||||||
input.future = yycline, input.money = &pair->value;
|
input.future = yycline, input.money = &pair->value;
|
||||||
fprintf(stderr, "%s[%zu]: new money <<%.*s>>.\n",
|
fprintf(stderr, "%s[%zu]: new income <<%.*s>>.\n",
|
||||||
datestr, line, (int)(s1 - s0), s0);
|
datestr, line, (int)(s1 - s0), s0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -457,7 +458,7 @@ static int scan_day(struct scan *const scan, union date32 date,
|
||||||
<mail> @s0 bralabel @s1 "]" => input_text {
|
<mail> @s0 bralabel @s1 "]" => input_text {
|
||||||
const union line64 key = { { (uint32_t)line, date } };
|
const union line64 key = { { (uint32_t)line, date } };
|
||||||
struct kvpair *pair;
|
struct kvpair *pair;
|
||||||
switch(linekvpair_tree_bulk_assign(&scan->vaccines, key, &pair)) {
|
switch(linekvpair_tree_bulk_assign(&scan->mails, key, &pair)) {
|
||||||
case TREE_PRESENT: fail = "duplicate"; case TREE_ERROR: goto catch;
|
case TREE_PRESENT: fail = "duplicate"; case TREE_ERROR: goto catch;
|
||||||
case TREE_ABSENT: break;
|
case TREE_ABSENT: break;
|
||||||
}
|
}
|
||||||
|
@ -469,6 +470,22 @@ static int scan_day(struct scan *const scan, union date32 date,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<couch> * { fail = "couch unrecognized"; goto catch; }
|
||||||
|
<couch> @s0 bralabel @s1 "]" => input_text {
|
||||||
|
const union line64 key = { { (uint32_t)line, date } };
|
||||||
|
struct kvpair *pair;
|
||||||
|
switch(linekvpair_tree_bulk_assign(&scan->couches, 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 couch <<%.*s>>.\n",
|
||||||
|
datestr, line, (int)(s1 - s0), s0);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
<place> * { fail = "place unrecognized"; goto catch; }
|
<place> * { fail = "place unrecognized"; goto catch; }
|
||||||
<place> @s0 parlabel @s1 / "\n" => skip { also_place: {
|
<place> @s0 parlabel @s1 / "\n" => skip { also_place: {
|
||||||
const struct pair keyword = pair(s0, s1);
|
const struct pair keyword = pair(s0, s1);
|
||||||
|
@ -936,6 +953,7 @@ void scan_(struct scan *const scan) {
|
||||||
glider_tree_(&scan->gliders);
|
glider_tree_(&scan->gliders);
|
||||||
linekvmoney_tree_(&scan->incomes);
|
linekvmoney_tree_(&scan->incomes);
|
||||||
linekvmoney_tree_(&scan->taxes);
|
linekvmoney_tree_(&scan->taxes);
|
||||||
|
linekvpair_tree_(&scan->couches);
|
||||||
linekvpair_tree_(&scan->medications);
|
linekvpair_tree_(&scan->medications);
|
||||||
linekvpair_tree_(&scan->vaccines);
|
linekvpair_tree_(&scan->vaccines);
|
||||||
linekvpair_tree_(&scan->ideas);
|
linekvpair_tree_(&scan->ideas);
|
||||||
|
@ -1017,6 +1035,7 @@ struct scan scan(struct journal *const jrnl) {
|
||||||
|| !linekvpair_tree_bulk_finish(&scan.ideas)
|
|| !linekvpair_tree_bulk_finish(&scan.ideas)
|
||||||
|| !linekvpair_tree_bulk_finish(&scan.vaccines)
|
|| !linekvpair_tree_bulk_finish(&scan.vaccines)
|
||||||
|| !linekvpair_tree_bulk_finish(&scan.medications)
|
|| !linekvpair_tree_bulk_finish(&scan.medications)
|
||||||
|
|| !linekvpair_tree_bulk_finish(&scan.couches)
|
||||||
|| !linekvmoney_tree_bulk_finish(&scan.taxes)
|
|| !linekvmoney_tree_bulk_finish(&scan.taxes)
|
||||||
|| !linekvmoney_tree_bulk_finish(&scan.incomes)
|
|| !linekvmoney_tree_bulk_finish(&scan.incomes)
|
||||||
|| !glider_tree_bulk_finish(&scan.gliders)
|
|| !glider_tree_bulk_finish(&scan.gliders)
|
||||||
|
|
Loading…
Reference in New Issue