Commit a1de750c authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-07-03 09:03:26 by afrisch] Manual

Original author: afrisch
Date: 2004-07-03 09:03:26+00:00
parent 1b6a094a
...@@ -304,18 +304,24 @@ which represents concatenation. ...@@ -304,18 +304,24 @@ which represents concatenation.
<code>%%R%%+?</code>, <code>%%R%%+?</code>,
<code>%%R%%*?</code>. For types, there is no distinction in semantics between <code>%%R%%*?</code>. For types, there is no distinction in semantics between
greedy and ungreedy. </li> greedy and ungreedy. </li>
<li>A sequence capture variable <code>%%x%%::%%R%%</code>. <li>A sequence capture variable <code>%%x%%::%%R%%</code>
(only for patterns, of course).
The semantics is to capture in <code>%%x%%</code> the subsequence The semantics is to capture in <code>%%x%%</code> the subsequence
matched by <code>%%R%%</code>. The same sequence capture variable matched by <code>%%R%%</code>. The same sequence capture variable
can appear several times inside a regular expression, including can appear several times inside a regular expression, including
under repetition operators; in that case, all the corresponding under repetition operators; in that case, all the corresponding
subsequences are concatenated together. subsequences are concatenated together. Two instances of the
same sequence capture variable cannot be nested, as in
<code>[x :: (1 x :: Int)]</code>.
<br/> <br/>
Note the difference between <code>[ x::Int ]</code> and Note the difference between <code>[ x::Int ]</code> and
<code>[ (x &amp; Int) ]</code>. Both accept sequences made of a single <code>[ (x &amp; Int) ]</code>. Both accept sequences made of a single
integer, but the first one binds <code>x</code> to a sequence integer, but the first one binds <code>x</code> to a sequence
(of a single integer), whereas the second one binds it to (of a single integer), whereas the second one binds it to
the integer itself.</li> the integer itself.</li>
<li>
Grouping <code>(%%R%%)</code>. E.g.: <code>[ x::(Int Int) y ]</code>.
</li>
</ul> </ul>
<p> <p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment