mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Start single-quote literal parser work
This commit is contained in:
parent
b25862a93b
commit
dc2016dc0d
5 changed files with 141 additions and 0 deletions
|
@ -203,6 +203,7 @@ fn parse_loc_term_or_underscore<'a>(
|
|||
one_of!(
|
||||
loc_expr_in_parens_etc_help(min_indent),
|
||||
loc!(specialize(EExpr::Str, string_literal_help())),
|
||||
loc!(specialize(EExpr::SingleQuote, single_quote_literal_help())),
|
||||
loc!(specialize(EExpr::Number, positive_number_literal_help())),
|
||||
loc!(specialize(EExpr::Lambda, closure_help(min_indent, options))),
|
||||
loc!(underscore_expression()),
|
||||
|
@ -225,6 +226,7 @@ fn parse_loc_term<'a>(
|
|||
one_of!(
|
||||
loc_expr_in_parens_etc_help(min_indent),
|
||||
loc!(specialize(EExpr::Str, string_literal_help())),
|
||||
loc!(specialize(EExpr::SingleQuote, single_quote_literal_help())),
|
||||
loc!(specialize(EExpr::Number, positive_number_literal_help())),
|
||||
loc!(specialize(EExpr::Lambda, closure_help(min_indent, options))),
|
||||
loc!(record_literal_help(min_indent)),
|
||||
|
@ -2340,6 +2342,13 @@ fn string_literal_help<'a>() -> impl Parser<'a, Expr<'a>, EString<'a>> {
|
|||
map!(crate::string_literal::parse(), Expr::Str)
|
||||
}
|
||||
|
||||
fn single_quote_literal_help<'a>() -> impl Parser<'a, Expr<'a>, EString<'a>> {
|
||||
map!(
|
||||
crate::string_literal::parse_single_quote(),
|
||||
Expr::SingleQuote
|
||||
)
|
||||
}
|
||||
|
||||
fn positive_number_literal_help<'a>() -> impl Parser<'a, Expr<'a>, Number> {
|
||||
map!(
|
||||
crate::number_literal::positive_number_literal(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue