Skip to content

Commit

Permalink
Update PatternMatching.md
Browse files Browse the repository at this point in the history
Fix grammatical errors in documentation.
  • Loading branch information
tdadadavid authored Dec 18, 2023
1 parent dc8a4d3 commit f022d4d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Pattern matching is _the_ mechanism for case distinction
([Switch]((Rascal:Statements-Switch)) statement) and search ([Visit]((Rascal:Expressions-Visit)) statement) in Rascal.
Patterns can also be used in an explicit match operator `:=` and can then be part of larger boolean expressions.
Since a pattern match may have more than one solution, local backtracking over the alternatives of a match is provided.
Patterns can also be used in [Enumerators]((Rascal:Boolean-Enumerator))s and control structures like
Patterns can also be used in [Enumerators]((Rascal:Boolean-Enumerator)) and control structures like
[For]((Rascal:Statements-For)) and [While]((Rascal:Statements-While)) statement.

A very rich pattern language is provided that includes string matching based on regular expressions,
Expand All @@ -47,7 +47,7 @@ Regular expressions follow the Java regular expression syntax with one exception
<_Name_:_RegularExpression_>
```

If `RegularExpression` matches, the matched substring is assigned to string variable `Name`.
If `RegularExpression` matches, the matched substring is assigned to the string variable `Name`.

The following abstract pattern matches the abstract syntax of a while statement defined earlier:

Expand Down

0 comments on commit f022d4d

Please sign in to comment.