This PR adds support for negative numbers (ints and floats) in the boot parser. The motivation for this addition follows.
We can then match on negative integers (right now we can only match on positive integers).
We do not have to re-discover negative numbers after transformations, such as constant folding or partial evaluation, and translate these to applications of negi or negf on positive numbers before, e.g., pretty printing.
There is no ambiguity between negative number literals and applications of negation operations negi and negf.
An effect of this change is that it is allowed to project from records with, e.g., t.-1, which is well typed if t : all a. { #label"-1" : a, ... }.
This PR adds support for negative numbers (ints and floats) in the boot parser. The motivation for this addition follows.
negi
ornegf
on positive numbers before, e.g., pretty printing.negi
andnegf
.An effect of this change is that it is allowed to project from records with, e.g.,
t.-1
, which is well typed ift : all a. { #label"-1" : a, ... }
.This PR solves https://github.com/miking-lang/miking/issues/796, except that it does not make any changes to
mexpr/parser.mc
.