mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Introduce Bool and rename String to Str
This commit is contained in:
parent
46f281d399
commit
be7e65bc88
2 changed files with 5 additions and 3 deletions
|
@ -4,12 +4,12 @@ pub enum Expr {
|
|||
// Literals
|
||||
Int(i64),
|
||||
Frac(i64, u64),
|
||||
String(String),
|
||||
Str(String),
|
||||
Char(char),
|
||||
Bool(bool),
|
||||
|
||||
Var(String),
|
||||
Let(Pattern, Box<Expr>, Box<Expr>),
|
||||
Pattern(Pattern),
|
||||
|
||||
// Functions
|
||||
Func(String, Box<Expr>),
|
||||
|
|
|
@ -118,6 +118,8 @@ parser! {
|
|||
|
||||
choice((
|
||||
parenthetical_expr(min_indent),
|
||||
string("True").with(value(Expr::Bool(true))),
|
||||
string("False").with(value(Expr::Bool(false))),
|
||||
string_literal(),
|
||||
number_literal(),
|
||||
char_literal(),
|
||||
|
@ -314,7 +316,7 @@ where I: Stream<Item = char, Position = IndentablePosition>,
|
|||
I::Error: ParseError<I::Item, I::Range, I::Position>
|
||||
{
|
||||
between(char('"'), char('"'), many(string_body()))
|
||||
.map(|str| Expr::String(str))
|
||||
.map(|str| Expr::Str(str))
|
||||
}
|
||||
|
||||
pub fn char_literal<I>() -> impl Parser<Input = I, Output = Expr>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue