parser
Parser for FinchLogic programs as LogicNode.str prints them, so that parse_logic(str(prgm)) == prgm whenever the literals of prgm print as values (see format_literal). Literals are read as a small subset of Python, whose names are looked up in a namespace of operators, numpy scalar types, finch dtypes and fills, rather than evaluated.
parse_logic(text, namespace=None)
¶
Parse a program, or an expression, as LogicNode.str prints it. Names in literals are looked up in LITERALS, updated with namespace if given, which can name values that don't print as text, such as tensors.