Skip to content

Commit 969d95e

Browse files
committed
Added 128bit ints
Added i128 and u128 to the AST, pretty-printing and the WIP parser. This should fix #8.
1 parent a2d125b commit 969d95e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Language/Rust/Parser/Parser2.y

+2
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,8 @@ lit (Spanned (LiteralTok litTok suffix_m) s) = Spanned (parseLit litTok suffix s
912912
(Just (Name "u32")) -> U32
913913
(Just (Name "i64")) -> I64
914914
(Just (Name "u64")) -> U64
915+
(Just (Name "i128")) -> I128
916+
(Just (Name "u128")) -> U128
915917
916918
isPathSegmentIdent :: Ident -> Bool
917919
isPathSegmentIdent i = True

src/Language/Rust/Syntax/AST.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,8 @@ data LifetimeDef a
432432
-- Merged [FloatTy](https://docs.serde.rs/syntex_syntax/ast/enum.FloatTy.html)
433433
data Suffix
434434
= Unsuffixed
435-
| Is | I8 | I16 | I32 | I64
436-
| Us | U8 | U16 | U32 | U64
435+
| Is | I8 | I16 | I32 | I64 | I128
436+
| Us | U8 | U16 | U32 | U64 | U128
437437
| F32 | F64
438438
deriving (Eq, Enum, Bounded)
439439

@@ -444,11 +444,13 @@ instance Show Suffix where
444444
show I16 = "i16"
445445
show I32 = "i32"
446446
show I64 = "i64"
447+
show I128 = "i128"
447448
show Us = "usize"
448449
show U8 = "u8"
449450
show U16 = "u16"
450451
show U32 = "u32"
451452
show U64 = "u64"
453+
show U128 = "u128"
452454
show F32 = "f32"
453455
show F64 = "f64"
454456

0 commit comments

Comments
 (0)