From 40f37d5126d8f77277aaea481d5a18e2514067bf Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 16 Jul 2017 17:58:46 +0000 Subject: [PATCH] .tutorial git-svn-id: svn://ultimatepp.org/upp/trunk@11254 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- tutorial/CoreTutorial/Parallel.cpp | 2 +- tutorial/CoreTutorial/Tutorial.cpp | 31 ++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tutorial/CoreTutorial/Parallel.cpp b/tutorial/CoreTutorial/Parallel.cpp index 11370cb49..271a773b3 100644 --- a/tutorial/CoreTutorial/Parallel.cpp +++ b/tutorial/CoreTutorial/Parallel.cpp @@ -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 x{ "zero", "one", "two", "three", "four", "five" }; diff --git a/tutorial/CoreTutorial/Tutorial.cpp b/tutorial/CoreTutorial/Tutorial.cpp index 67d3106a0..235122933 100644 --- a/tutorial/CoreTutorial/Tutorial.cpp +++ b/tutorial/CoreTutorial/Tutorial.cpp @@ -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(); }