mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Plain number literals (e.g. 5
) are now Num *
This commit is contained in:
parent
9081b7f2d1
commit
3ecbe0325c
21 changed files with 345 additions and 223 deletions
|
@ -3,7 +3,7 @@ use crate::def::{can_defs_with_return, Def};
|
|||
use crate::env::Env;
|
||||
use crate::num::{
|
||||
finish_parsing_base, finish_parsing_float, finish_parsing_int, float_expr_from_result,
|
||||
int_expr_from_result,
|
||||
int_expr_from_result, num_expr_from_result,
|
||||
};
|
||||
use crate::pattern::{canonicalize_pattern, Pattern};
|
||||
use crate::procedure::References;
|
||||
|
@ -33,6 +33,7 @@ pub struct Output {
|
|||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Expr {
|
||||
// Literals
|
||||
Num(Variable, i64),
|
||||
Int(Variable, i64),
|
||||
Float(Variable, f64),
|
||||
Str(Box<str>),
|
||||
|
@ -144,8 +145,8 @@ pub fn canonicalize_expr<'a>(
|
|||
use Expr::*;
|
||||
|
||||
let (expr, output) = match expr {
|
||||
ast::Expr::Int(string) => {
|
||||
let answer = int_expr_from_result(var_store, finish_parsing_int(*string), env);
|
||||
ast::Expr::Num(string) => {
|
||||
let answer = num_expr_from_result(var_store, finish_parsing_int(*string), env);
|
||||
|
||||
(answer, Output::default())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue