[m-rev.] for review: a slot for each kind of operator
Julien Fischer
jfischer at opturion.com
Mon Nov 14 11:32:59 AEDT 2022
On Mon, 14 Nov 2022, Zoltan Somogyi wrote:
> Give each op class (infix, prefix etc) its own slot.
>
> library/ops.m:
> Instead of an op_table mapping a string to a list of one or more op_infos,
> make it map the string to a single structure, the op_infos, which has
> four slots, one each for infix, binary prefix, prefix and postfix
> op information. This allows parsers and unparsers to go directly to
> the kind of operator (e.g. infix or prefix) that they are interested in.
>
> NEWS:
> Announce the change.
>
> compiler/parse_tree_out_term.m:
> library/mercury_term_parser.m:
> library/pretty_printer.m:
> library/stream.string_writer.m:
> library/string.to_string.m:
> samples/calculator2.m:
> tests/hard_coded/bug383.m:
> Conform to the change. In several places, the new operator representation
> allows the replacement of loops with direct lookups, and the replacement
> of if-then-else chains with switches.
>
> Add reminders about keeping two predicates in sync.
That's fine.
Julien.
More information about the reviews
mailing list