From 81e39859b8800e358cf0130048f4e9147f3efaa9 Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Fri, 8 Jul 2022 14:33:10 +0900 Subject: [PATCH] Update 04-Parsing-Input.md --- .../04-Tasks-and-Commands/04-Parsing-Input.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reference/02-DetailTopics/04-Tasks-and-Commands/04-Parsing-Input.md b/src/reference/02-DetailTopics/04-Tasks-and-Commands/04-Parsing-Input.md index f4b1fdd6..0139e3ae 100644 --- a/src/reference/02-DetailTopics/04-Tasks-and-Commands/04-Parsing-Input.md +++ b/src/reference/02-DetailTopics/04-Tasks-and-Commands/04-Parsing-Input.md @@ -88,13 +88,13 @@ a parser. ```scala // A parser that succeeds if the input is "blue" or "green", // returning the matched input -val color: Parser[String] = "blue" | "green" +val color: Parser[String] = literal("blue") | "green" // A parser that matches either "fg" or "bg" -val select: Parser[String] = "fg" | "bg" +val select: Parser[String] = literal("fg") | "bg" // A parser that matches "fg" or "bg", a space, and then the color, returning the matched values. -val setColor: Parser[(String, Char, String)] = +val setColor: Parser[((String, Char), String)] = select ~ ' ' ~ color // Often, we don't care about the value matched by a parser, such as the space above