Support negative value in ir parser

This commit is contained in:
Minseong Jang
2022-03-25 14:41:54 +09:00
parent c8813ac7a2
commit 271e95ab1d

View File

@@ -394,10 +394,18 @@ peg::parser! {
f:float_number() {
Constant::float(f, Dtype::float(64)) // TODO: the right dtype
}
/
"-" f:float_number() {
Constant::minus(Constant::float(f, Dtype::float(64))) // TODO: the right dtype
}
/
n:number() {
Constant::int(n as _, Dtype::int(128)) // TODO: the right dtype
}
/
"-" n:number() {
Constant::minus(Constant::int(n as _, Dtype::int(128))) // TODO: the right dtype
}
/
"undef" {
Constant::undef(Dtype::unit()) // TODO