mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Introduce Ident alias
This commit is contained in:
parent
352ab5ed34
commit
2872841f6e
2 changed files with 5 additions and 3 deletions
|
@ -11,11 +11,11 @@ pub enum Expr {
|
||||||
Char(char),
|
Char(char),
|
||||||
Bool(bool),
|
Bool(bool),
|
||||||
|
|
||||||
Var(String),
|
Var(Ident),
|
||||||
Let(Pattern, Box<Expr>, Box<Expr>),
|
Let(Pattern, Box<Expr>, Box<Expr>),
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
Func(String, Vec<Expr>),
|
Func(Ident, Vec<Expr>),
|
||||||
Apply(Box<Expr>, Vec<Expr>),
|
Apply(Box<Expr>, Vec<Expr>),
|
||||||
Operator(Box<Expr>, Operator, Box<Expr>),
|
Operator(Box<Expr>, Operator, Box<Expr>),
|
||||||
Closure(SmallVec<[Pattern; 4]>, Box<Expr>),
|
Closure(SmallVec<[Pattern; 4]>, Box<Expr>),
|
||||||
|
@ -34,6 +34,8 @@ pub enum Expr {
|
||||||
Error(Problem),
|
Error(Problem),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Ident = String;
|
||||||
|
|
||||||
impl fmt::Display for Expr {
|
impl fmt::Display for Expr {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use expr::Operator;
|
use expr::Operator;
|
||||||
use expr::{Expr, Pattern};
|
use expr::{Expr, Pattern, Ident};
|
||||||
|
|
||||||
use std::char;
|
use std::char;
|
||||||
use parse_state::{IndentablePosition};
|
use parse_state::{IndentablePosition};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue