Convert int values to i64 in accordance with spec
This commit is contained in:
parent
cd93c1a3bd
commit
8d856d0651
2 changed files with 3 additions and 3 deletions
|
@ -4,17 +4,17 @@ use std::fmt;
|
|||
#[derive(Debug, PartialEq)]
|
||||
pub enum Expression<'source> {
|
||||
EmptyLiteral(CodeLocation),
|
||||
IntLiteral(CodeLocation, u32),
|
||||
IntLiteral(CodeLocation, i64),
|
||||
BoolLiteral(CodeLocation, bool),
|
||||
Identifier(CodeLocation, &'source str),
|
||||
UnaryOp(CodeLocation, &'source str, Box<Expression<'source>>),
|
||||
VarDeclaration(CodeLocation, &'source str, Box<Expression<'source>>),
|
||||
BinaryOp(
|
||||
CodeLocation,
|
||||
Box<Expression<'source>>,
|
||||
&'source str,
|
||||
Box<Expression<'source>>,
|
||||
),
|
||||
VarDeclaration(CodeLocation, &'source str, Box<Expression<'source>>),
|
||||
Conditional(
|
||||
CodeLocation,
|
||||
Box<Expression<'source>>,
|
||||
|
|
|
@ -260,7 +260,7 @@ fn parse_int_literal<'source>(pos: &mut usize, tokens: &[Token]) -> Expression<'
|
|||
token.loc,
|
||||
token
|
||||
.text
|
||||
.parse::<u32>()
|
||||
.parse::<i64>()
|
||||
.unwrap_or_else(|_| panic!("Fatal parser error! Invalid value in token {token}")),
|
||||
)
|
||||
}
|
||||
|
|
Reference in a new issue