Introduce Ident alias

This commit is contained in:
Richard Feldman 2019-05-31 11:00:17 -04:00
parent 352ab5ed34
commit 2872841f6e
2 changed files with 5 additions and 3 deletions

View file

@ -11,11 +11,11 @@ pub enum Expr {
Char(char),
Bool(bool),
Var(String),
Var(Ident),
Let(Pattern, Box<Expr>, Box<Expr>),
// Functions
Func(String, Vec<Expr>),
Func(Ident, Vec<Expr>),
Apply(Box<Expr>, Vec<Expr>),
Operator(Box<Expr>, Operator, Box<Expr>),
Closure(SmallVec<[Pattern; 4]>, Box<Expr>),
@ -34,6 +34,8 @@ pub enum Expr {
Error(Problem),
}
type Ident = String;
impl fmt::Display for Expr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {

View file

@ -1,5 +1,5 @@
use expr::Operator;
use expr::{Expr, Pattern};
use expr::{Expr, Pattern, Ident};
use std::char;
use parse_state::{IndentablePosition};