Commit 5eac8b00 authored by Pietro Abate's avatar Pietro Abate

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

Original author: afrisch
Date: 2004-07-03 09:03:26+00:00
parent f2e5b194
......@@ -304,18 +304,24 @@ which represents concatenation.
<code>%%R%%+?</code>,
<code>%%R%%*?</code>. For types, there is no distinction in semantics between
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
matched by <code>%%R%%</code>. The same sequence capture variable
can appear several times inside a regular expression, including
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/>
Note the difference between <code>[ x::Int ]</code> and
<code>[ (x &amp; Int) ]</code>. Both accept sequences made of a single
integer, but the first one binds <code>x</code> to a sequence
(of a single integer), whereas the second one binds it to
the integer itself.</li>
<li>
Grouping <code>(%%R%%)</code>. E.g.: <code>[ x::(Int Int) y ]</code>.
</li>
</ul>
<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