<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>He Levente.<br></div><div><br></div><div>Thank you very much. This is a huge time saver. <br></div><div><br></div><div>I was literally reading the wrong documentation. <br></div><div><br></div><div>whew!<br></div><div><br></div><div>Where is this documented? I do not see it on the wiki link you sent me. <br></div><div>Is it infferable from a class in the XTreams packages?<br></div><div><br></div><div>I looked over the XTreams tests classes yesterday and did not see any clues.<br></div><div>Do the test cases need improving? (I can contribute by doing the grunt work under supervision)</div><div><br></div><div>Also, what does "don't yield them" mean?<br></div><div><br></div><div>Does it mean the parser stays in its present spot?<br></div><div><br></div><div>thank you again.<br></div><div><br></div><div>t.<br></div><div><br></div><div>p.s. I have cc'ed squeak-beginners list on this message.</div><div><br></div><div><br></div><br><div style="" class="zmail_extra"><br><div id="Zm-_Id_-Sgn1">---- On Tue, 10 Sep 2019 20:30:07 -0400 <b>Levente Uzonyi <leves@caesar.elte.hu></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div>Hi Tim, <br> <br>On Tue, 10 Sep 2019, gettimothy wrote: <br> <br>> Hi Levente. <br>> <br>> If you don't have time for this, "No" is  a good answer. <br>> <br>> I have the WikiMedia freelinks working. <a target="_blank" href="https://en.wikipedia.org/wiki/Help:Wikitext#Free_links">https://en.wikipedia.org/wiki/Help:Wikitext#Free_links</a> <br>> <br>> [[This Is A Link]] generates  <br>> <br>> <a href="<a target="_blank" href="https://en.wikipedia.org/wiki/This_is_a_link">https://en.wikipedia.org/wiki/This_is_a_link</a>">This is a link</a> <br>> <br>> I would like to translate the FreeLink <- "[[" .{&[>\]]} "]]" sequence into something like <br>> <br>> FreeLink <- LinkOpen  .{&[>\]]}  LinkClose <br>> LinkOpen   <- BracketOpen BracketOpen <br>> LinkClose   <- BracketClose BracketClose <br>> BracketOpen <- "[" <br>> BracketClose <- "]" <br>> <br>> so that I can iteratively build up to more complicated link styles. <br>> <br>> That Capture in the middle of the sequence is giving me fits. <br>> Something as simple as: <br>> <br>> FreeLink <- LinkOpen  .{&[>\]]}  LinkClose <br>> <br>> does not parse as neither LinkOpen nor LinkClose are consumed. <br>> <br>> My interpretation of that middle sequence term is: <br>> "." get the next character and consume it. <br>> {&[>\]]} apply expression &[>\]] and capture the string that matched it for later use. <br> <br>In Xtreams-Parsing, braces don't mean capture. They mean cardinality. It <br>comes from common regular expression syntax. <br>The regular expression x{1,3} means x 1 to 3 times, so it accepts x, <br>xx, and xxx. <br>You can also pass a single number x{3}, which is a shorthand for xxx. <br>You can also omit the second argument like in x{3,}, which means x 3 or <br>more times. <br>This construct is extended in Xtreams-Parsing with a stop expression. <br>"x"{"y"} means, accept any number of x up until y comes. Consume y too, <br>but don't yield it. So, such expression accepts: xy, xxy, xxxy, xxxxy, <br>etc, and yields x, xx, xxx, xxxx, etc. <br> <br>I suspect having & inside {} probably causes problems, because {} tries to <br>consume what it parses, but & tells the parser not to consume what comes <br>after it. <br> <br>If I were to write the FreeLink rule, it would be something like: <br> <br>FreeLink <- "[[" .{"]]"} <br> <br>It means: take two opening braces, accept and yield everything up to two <br>closing braces, then consume those too, but don't yield them. <br> <br> <br>Levente <br> <br>> &[>\]] AND predicate : indicate success if expression [>\]] matches text ahead; otherwise indicate failure. do not consume text. <br>> [>\]]  character range between ">" and "]" <br>> <br>> <br>> Thanks for your time. <br>> <br>> cordially, <br>> <br>> t <br>> <br>> <br>> <br>> <br>> <br>> <br>></div></blockquote></div><div><br></div></div><br></body></html>