.tutorial

git-svn-id: svn://ultimatepp.org/upp/trunk@11254 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-07-16 17:58:46 +00:00
parent ac94ff5afb
commit 40f37d5126
2 changed files with 18 additions and 15 deletions

View file

@ -7,7 +7,7 @@ void CoAlgoTutorial()
/// U++ provides a parallel versions of algorithms where it makes sense. The naming scheme
/// is 'Co' prefix before the name of algorithm designates the parallel version.
/// So the parallel version of e.g. `FindIndex` is `CoFindIndex`, for 'Sort' it is 'CoSort':
/// So the parallel version of e.g. `FindIndex` is `CoFindIndex`, for `Sort` it is `CoSort`:
Vector<String> x{ "zero", "one", "two", "three", "four", "five" };

View file

@ -43,7 +43,6 @@ void FlushDoc(String& docblock)
String style = "[s3;";
String lbl;
if(docblock.StartsWith(".")) {
docblock = AsString(major) + "." + AsString(++minor) + ' ' + TrimBoth(docblock.Mid(1));
style = minor == 1 ? "[s2;" : "[s2;H4";
lbl = "Section_" + AsString(major) + "_" + AsString(minor);
@ -55,7 +54,7 @@ void FlushDoc(String& docblock)
const char *s = docblock;
String qtf2;
String plain;
while(*s)
if((s == ~docblock || findarg(s[-1], '(', ' ', '\'', '\"') >= 0) && findarg(s[0], '*', '%', '_', '`', '^') >= 0 && s[1] && s[1] != ' ') {
int c = *s++;
@ -67,28 +66,32 @@ void FlushDoc(String& docblock)
s++;
}
if(c == '^') {
qtf2 << "[^";
qtf << "[^";
if(dc) {
qtf2.Cat(b, dc);
qtf.Cat(b, dc);
b = dc + 1;
}
else
qtf2.Cat(b, s);
qtf2 << "^ ";
qtf.Cat(b, s);
qtf << "^ ";
}
else
qtf2 << decode(c, '*', "[* ", '%', "[/ ", '_', "[_ ", '`', title ? "[C@5 " : "[C@5* ", "");
while(b < s)
qtf2 << '`' << *b++;
qtf2 << "]";
qtf << decode(c, '*', "[* ", '%', "[/ ", '_', "[_ ", '`', title ? "[C@5 " : "[C@5* ", "");
while(b < s) {
plain << '`' << *b;
qtf << '`' << *b++;
}
qtf << "]";
if(*s) s++;
}
else
qtf2 << '`' << *s++;
else {
plain << '`' << *s;
qtf << '`' << *s++;
}
qtf << qtf2 << "&]";
qtf << "&]";
if(lbl.GetCount())
toc << "___[A2^" << lbl << "^ " << qtf2 << "]&";
toc << "___[A2^" << lbl << "^ " << plain << "]&";
docblock.Clear();
}