Added extra_info as resolve-call site addendum
This commit is contained in:
@@ -3,6 +3,9 @@ import * as CF from '@efforting.tech/data/field-configuration-factories';
|
||||
import { inspect } from 'node:util';
|
||||
import { Text_Tree_Node, Text_Tree_Settings } from '@efforting.tech/text/basic-tree';
|
||||
import { RegExp_Resolver } from '@efforting.tech/rule-processing/resolvers';
|
||||
import { parse_csv } from '@efforting.tech/data/string-utilities';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +29,11 @@ const root = Text_Tree_Node.from_string(ts, example_string);
|
||||
|
||||
const d = new RegExp_Resolver([
|
||||
[/^animals:\s*(.*)$/, (c) => console.log("ANIMAL", c)],
|
||||
[/^trees:\s*(.*)$/, () => console.log("TREE")],
|
||||
[/^trees:\s*(.*)$/, ({node, predicate_result}) => console.log(`TREE of node at line ${node.line_no}:`, parse_csv(predicate_result[1]))],
|
||||
]);
|
||||
|
||||
for (const child of root.children) {
|
||||
if (child.has_line) {
|
||||
console.log(child.line, d.resolve(child.line));
|
||||
console.log(child.line, d.resolve(child.line, { node: child }));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user