mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 15:08:52 +00:00
Support negative value in ir parser
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user