mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 15:38:48 +00:00
Support negative value in ir parser
This commit is contained in:
@@ -394,10 +394,18 @@ peg::parser! {
|
|||||||
f:float_number() {
|
f:float_number() {
|
||||||
Constant::float(f, Dtype::float(64)) // TODO: the right dtype
|
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() {
|
n:number() {
|
||||||
Constant::int(n as _, Dtype::int(128)) // TODO: the right dtype
|
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" {
|
"undef" {
|
||||||
Constant::undef(Dtype::unit()) // TODO
|
Constant::undef(Dtype::unit()) // TODO
|
||||||
|
|||||||
Reference in New Issue
Block a user