number types
This commit is contained in:
parent
c51a7fd0fc
commit
eafed4f9ed
3 changed files with 8 additions and 8 deletions
|
|
@ -62,8 +62,8 @@ pub struct Definition {
|
||||||
/// A reduced value.
|
/// A reduced value.
|
||||||
#[derive(PartialEq, PartialOrd, Debug, Clone)]
|
#[derive(PartialEq, PartialOrd, Debug, Clone)]
|
||||||
pub enum Value {
|
pub enum Value {
|
||||||
Int(i64),
|
Int(i32),
|
||||||
Float(f64),
|
Float(f32),
|
||||||
String(String),
|
String(String),
|
||||||
Boolean(bool),
|
Boolean(bool),
|
||||||
Record(Record),
|
Record(Record),
|
||||||
|
|
@ -159,14 +159,14 @@ impl Expr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<i64> for Value {
|
impl From<i32> for Value {
|
||||||
fn from(i: i64) -> Value {
|
fn from(i: i32) -> Value {
|
||||||
Value::Int(i)
|
Value::Int(i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<i64> for Expr {
|
impl From<i32> for Expr {
|
||||||
fn from(i: i64) -> Expr {
|
fn from(i: i32) -> Expr {
|
||||||
Expr::Value(i.into())
|
Expr::Value(i.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ pub fn scan(source: String) -> Tokens {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let i = str.parse::<u32>().unwrap();
|
let i = str.parse::<u16>().unwrap();
|
||||||
tokens.push(LocatedToken {
|
tokens.push(LocatedToken {
|
||||||
start,
|
start,
|
||||||
end: scanner.cursor(),
|
end: scanner.cursor(),
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ pub enum Token {
|
||||||
Colon,
|
Colon,
|
||||||
True,
|
True,
|
||||||
False,
|
False,
|
||||||
Number(u32),
|
Number(u16),
|
||||||
String(String),
|
String(String),
|
||||||
Identifier(String),
|
Identifier(String),
|
||||||
Label(String),
|
Label(String),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue