diff options
author | Neil <nyamatongwe@gmail.com> | 2016-04-28 09:54:46 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2016-04-28 09:54:46 +1000 |
commit | 474aab1c941497ae8275289bb0d7e5a214faeb2f (patch) | |
tree | 570e8d2cc97308e2a74c1acf1952f80411d260ec | |
parent | 96d08cb93e220189eaa4045511fe1bc2d0aae9c2 (diff) | |
download | scintilla-mirror-474aab1c941497ae8275289bb0d7e5a214faeb2f.tar.gz |
C++ 11 <regex> support built by default.
-rw-r--r-- | doc/ScintillaDoc.html | 38 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 11 | ||||
-rw-r--r-- | include/Scintilla.iface | 2 | ||||
-rw-r--r-- | src/Document.cxx | 6 |
4 files changed, 37 insertions, 20 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index f1e6c3a75..5edf0caec 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -623,8 +623,9 @@ struct Sci_TextRange { <p> The base regular expression support is limited and should only be used for simple cases and initial development. - <span class="provisional">When using a C++11 compliant compiler and runtime, it may be possible to use the - runtime's implementation of <regex> by compiling Scintilla with <code>CXX11_REGEX</code> defined.</span> + The C++ runtime <regex> library may be used by setting the <code>SCFIND_CXX11REGEX</code> search flag. + When using an older C++ compiler that does not support C++11, this may be turned off by + compiling Scintilla with <code>NO_CXX11_REGEX</code> defined. A different regular expression library can be <a class="jump" href="#AlternativeRegEx">integrated into Scintilla</a> or can be called from the container using direct access to the buffer contents through @@ -743,29 +744,32 @@ struct Sci_TextRange { <tr> <td><code>SCFIND_REGEXP</code></td> - <td>The search string should be interpreted as a regular expression.</td> + <td>The search string should be interpreted as a regular expression. + Uses Scintilla's base implementation unless combined with <code>SCFIND_CXX11REGEX</code>.</td> </tr> <tr> <td><code>SCFIND_POSIX</code></td> <td>Treat regular expression in a more POSIX compatible manner - by interpreting bare ( and ) for tagged sections rather than \( and \).</td> + by interpreting bare ( and ) for tagged sections rather than \( and \). + Has no effect when <code>SCFIND_CXX11REGEX</code> is set.</td> </tr> - <tr class="provisional"> + <tr> <td><code>SCFIND_CXX11REGEX</code></td> - <td>When compiled with <code>CXX11_REGEX</code> this flag - may be set to use <regex> instead of Scintilla's basic regular expressions. - If the regular expression is invalid then -1 is returned and status is set to - <code>SC_STATUS_WARN_REGEX</code>. - The ECMAScript flag is set on the regex object and UTF-8 documents will exhibit Unicode-compliant - behaviour. For MSVC, where wchar_t is 16-bits, the reular expression ".." will match a single - astral-plane character. There may be other differences between compilers.</td> + <td>This flag may be set to use C++11 <regex> instead of Scintilla's basic regular expressions. + If the regular expression is invalid then -1 is returned and status is set to + <code>SC_STATUS_WARN_REGEX</code>. + The ECMAScript flag is set on the regex object and UTF-8 documents will exhibit Unicode-compliant + behaviour. For MSVC, where wchar_t is 16-bits, the reular expression ".." will match a single + astral-plane character. There may be other differences between compilers. + Must also have <code>SCFIND_REGEXP</code> set.</td> </tr> </tbody> </table> - <p>In a regular expression, special characters interpreted are:</p> + <p>In a regular expression, using Scintilla's base implementation, + special characters interpreted are:</p> <table border="0" summary="Regular expression synopsis"> <tbody> @@ -860,6 +864,10 @@ struct Sci_TextRange { <p>Regular expressions will only match ranges within a single line, never matching over multiple lines.</p> + <p>When using <code>SCFIND_CXX11REGEX</code> more features are available, + generally similar to regular expression support in JavaScript. + See the documentation of your C++ runtime for details on what is supported.</p> + <code><a class="message" href="#SCI_FINDTEXT">SCI_FINDTEXT(int flags, Sci_TextToFind *ttf)</a><br /> <a class="message" href="#SCI_SEARCHANCHOR">SCI_SEARCHANCHOR</a><br /> @@ -1020,7 +1028,7 @@ struct Sci_TextToFind { <td>Generic failure</td> </tr> - <tr class="provisional"> + <tr> <th align="left">SC_STATUS_BADALLOC</th> <td>2</td> <td>Memory is exhausted</td> @@ -7579,8 +7587,6 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next <code class="provisional">SC_TECHNOLOGY_DIRECTWRITEDC</code> values for <a class="message" href="#SCI_SETTECHNOLOGY">SCI_SETTECHNOLOGY</a> are provisional.</p> - <p>Using C++11 <regex> is provisional.</p> - <p>Some developers may want to only use features that are stable and have graduated from provisional status. To avoid using provisional messages compile with the symbol <code>SCI_DISABLE_PROVISIONAL</code> defined.</p> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index be5490dd9..8a0f01f65 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -500,6 +500,17 @@ </li> </ul> <h3> + <a href="http://www.scintilla.org/scite366.zip">Release 3.6.6</a> + </h3> + <ul> + <li> + Released 26 April 2016. + </li> + <li> + C++ 11 <regex> support built by default. Can be disabled by defining NO_CXX11_REGEX. + </li> + </ul> + <h3> <a href="http://www.scintilla.org/scite365.zip">Release 3.6.5</a> </h3> <ul> diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 71defe09d..310d877a9 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -4729,7 +4729,7 @@ evt void FocusIn=2028(void) evt void FocusOut=2029(void) evt void AutoCCompleted=2030(string text, int position, int ch, CompletionMethods listCompletionMethod) -# There are no provisional features currently +# There are no provisional APIs currently, but some arguments to SCI_SETTECHNOLOGY are provisional. cat Provisional diff --git a/src/Document.cxx b/src/Document.cxx index 5e58f26ee..d96a889bf 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -16,7 +16,7 @@ #include <vector> #include <algorithm> -#ifdef CXX11_REGEX +#ifndef NO_CXX11_REGEX #include <regex> #endif @@ -2336,7 +2336,7 @@ public: } }; -#ifdef CXX11_REGEX +#ifndef NO_CXX11_REGEX class ByteIterator : public std::iterator<std::bidirectional_iterator_tag, char> { public: @@ -2696,7 +2696,7 @@ long BuiltinRegex::FindText(Document *doc, int minPos, int maxPos, const char *s bool caseSensitive, bool, bool, int flags, int *length) { -#ifdef CXX11_REGEX +#ifndef NO_CXX11_REGEX if (flags & SCFIND_CXX11REGEX) { return Cxx11RegexFindText(doc, minPos, maxPos, s, caseSensitive, length, search); |