Skip to content

Commit f09b0ec

Browse files
authored
Merge pull request #102 from Zandbee/patch-1
Update Getting_Started.md
2 parents d118db9 + 399bbb8 commit f09b0ec

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

docs/Getting_Started.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ So what’s to notice here, in this new program? Well, the parser for "number" l
7777
* Doesn't have a .r because it isn't a regular expression (it's a combinator).
7878
* Returns instances of `Parser[WordFreq]`, so the function to the right hand side of the `^^` operator had better return instances of the composite type `WordFreq`.
7979
* Combines the "word" rule with the "number" rule. It uses the `~` (tilde) combinator to say "you have to match a word first, and then a number". The tilde combinator is the most common combinator for rules that don't involve regular expressions.
80-
81-
Uses a pattern match on the right side of the rule. Sometimes these match expressions are complex but many times they are just echoes of the rule on the left hand side. In that case, all it really does is gives names to the different elements of the rule (in this case "wd" and "fr") so that we can operate on those elements. In this case, we use those named elements to construct the object we are interested in. But there are also cases where the pattern match is not an echo of the left hand side. Those cases may arise when parts of the rule are optional, or when there are very specific cases to match. For instance, if we wanted to perform special handling in the case where fr was exactly 0. For that, we could have added the case:
80+
* Uses a pattern match on the right side of the rule. Sometimes these match expressions are complex but many times they are just echoes of the rule on the left hand side. In that case, all it really does is gives names to the different elements of the rule (in this case "wd" and "fr") so that we can operate on those elements. In this case, we use those named elements to construct the object we are interested in. But there are also cases where the pattern match is not an echo of the left hand side. Those cases may arise when parts of the rule are optional, or when there are very specific cases to match. For instance, if we wanted to perform special handling in the case where fr was exactly 0. For that, we could have added the case:
8281
```
8382
case wd ~ 0
8483
```

0 commit comments

Comments
 (0)