Enables parsing negative merge priorities
@@ -108,7 +108,7 @@ AnnotAtom<TypeRule>: MetaValue = {
priority: MergePriority::Top,
..Default::default()
},
- "|" "priority" <"num literal"> => MetaValue {
+ "|" "priority" <SignedNumLiteral> => MetaValue {
// unwrap(): a literal can't be NaN
priority: MergePriority::Numeral(NumeralPriority::try_from(<>).unwrap()),
..Default::default()
@@ -787,6 +787,14 @@ TypeAtom: Types = {
},
}
+SignedNumLiteral: f64 = <sign: "-"?> <value: "num literal"> => {
+ if sign.is_some() {
+ -value
+ } else {
+ value
+ }
+};
+
extern {
type Location = usize;
type Error = ParseError;
