summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/Boost/src/boost/spirit/home/support/detail/lexer')
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/debug.hpp4
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/generator.hpp22
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/size_t.hpp8
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/state_machine.hpp10
-rw-r--r--3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/string_token.hpp13
5 files changed, 18 insertions, 39 deletions
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/debug.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/debug.hpp
index 23cda87..36ee1bb 100644
--- a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/debug.hpp
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/debug.hpp
@@ -31,11 +31,7 @@ public:
const CharT *ptr_ = in_.c_str ();
std::size_t size_ = in_.size ();
-#if defined _MSC_VER && _MSC_VER <= 1200
- out_.erase ();
-#else
out_.clear ();
-#endif
while (size_)
{
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/generator.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/generator.hpp
index 49bea2f..daa06e7 100644
--- a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/generator.hpp
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/generator.hpp
@@ -12,6 +12,7 @@
#include "partition/charset.hpp"
#include "partition/equivset.hpp"
#include <memory>
+#include <limits>
#include "parser/tree/node.hpp"
#include "parser/parser.hpp"
#include "containers/ptr_list.hpp"
@@ -185,10 +186,10 @@ protected:
while (regex_iter_ != regex_iter_end_)
{
// re-declare var, otherwise we perform an assignment..!
- const typename rules::string &regex_ = *regex_iter_;
+ const typename rules::string &regex2_ = *regex_iter_;
- root_ = parser::parse (regex_.c_str (),
- regex_.c_str () + regex_.size (), *ids_iter_,
+ root_ = parser::parse (regex2_.c_str (),
+ regex2_.c_str () + regex2_.size (), *ids_iter_,
*unique_ids_iter_, *states_iter_, rules_.flags (),
rules_.locale (), node_ptr_vector_, macromap_, token_map_,
internals_._seen_BOL_assertion,
@@ -336,16 +337,16 @@ protected:
equiv_end_ = equivset_->_index_vector.end ();
equiv_iter_ != equiv_end_; ++equiv_iter_)
{
- const std::size_t index_ = *equiv_iter_;
+ const std::size_t equiv_index_ = *equiv_iter_;
- if (index_ == bol_token)
+ if (equiv_index_ == bol_token)
{
if (ptr_[eol_index] == 0)
{
ptr_[bol_index] = transition_;
}
}
- else if (index_ == eol_token)
+ else if (equiv_index_ == eol_token)
{
if (ptr_[bol_index] == 0)
{
@@ -354,7 +355,7 @@ protected:
}
else
{
- ptr_[index_ + dfa_offset] = transition_;
+ ptr_[equiv_index_ + dfa_offset] = transition_;
}
}
}
@@ -560,7 +561,12 @@ protected:
if (token_._negated)
{
- CharT curr_char_ = sizeof (CharT) == 1 ? -128 : 0;
+ // $$$ FIXME JDG July 2014 $$$
+ // this code is problematic on platforms where wchar_t is signed
+ // with min generating negative numbers. This crashes with BAD_ACCESS
+ // because of the vector index below:
+ // ptr_[static_cast<typename Traits::index_type>(curr_char_)]
+ CharT curr_char_ = 0; // (std::numeric_limits<CharT>::min)();
std::size_t i_ = 0;
while (curr_ < chars_end_)
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/size_t.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/size_t.hpp
index 349aa6d..449ff4d 100644
--- a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/size_t.hpp
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/size_t.hpp
@@ -8,14 +8,6 @@
#include <stddef.h> // ptrdiff_t
-#if defined _MSC_VER && _MSC_VER <= 1200
-namespace std
-{
- using ::ptrdiff_t;
- using ::size_t;
-}
-#else
#include <string>
-#endif
#endif
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/state_machine.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/state_machine.hpp
index e09e991..46e50c9 100644
--- a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/state_machine.hpp
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/state_machine.hpp
@@ -29,11 +29,7 @@ public:
class iterator
{
public:
-#if defined _MSC_VER && _MSC_VER <= 1200
- friend basic_state_machine;
-#else
friend class basic_state_machine;
-#endif
struct data
{
@@ -225,11 +221,7 @@ public:
}
};
-#if defined _MSC_VER && _MSC_VER <= 1200
- friend iterator;
-#else
friend class iterator;
-#endif
basic_state_machine ()
{
@@ -365,7 +357,7 @@ private:
{
const std::size_t col_ = lu_->at (alpha_index_);
- if (col_ != dead_state_index)
+ if (col_ != static_cast<std::size_t>(dead_state_index))
{
chars_[col_ - dfa_offset] += static_cast<CharT>
(alpha_index_);
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/string_token.hpp b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/string_token.hpp
index 6bfa6ff..dd58c98 100644
--- a/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/string_token.hpp
+++ b/3rdParty/Boost/src/boost/spirit/home/support/detail/lexer/string_token.hpp
@@ -10,6 +10,7 @@
#include "size_t.hpp"
#include "consts.hpp" // num_chars, num_wchar_ts
#include <string>
+#include <limits>
namespace boost
{
@@ -55,11 +56,7 @@ struct basic_string_token
if (_charset.length () == max_chars_)
{
_negated = !_negated;
-#if defined _MSC_VER && _MSC_VER <= 1200
- _charset.erase ();
-#else
_charset.clear ();
-#endif
}
else if (_charset.length () > max_chars_ / 2)
{
@@ -71,7 +68,7 @@ struct basic_string_token
{
const std::size_t max_chars_ = sizeof (CharT) == 1 ?
num_chars : num_wchar_ts;
- CharT curr_char_ = sizeof (CharT) == 1 ? -128 : 0;
+ CharT curr_char_ = (std::numeric_limits<CharT>::min)();
string temp_;
const CharT *curr_ = _charset.c_str ();
const CharT *chars_end_ = curr_ + _charset.size ();
@@ -126,11 +123,7 @@ struct basic_string_token
void clear ()
{
_negated = false;
-#if defined _MSC_VER && _MSC_VER <= 1200
- _charset.erase ();
-#else
- _charset.clear ();
-#endif
+ _charset.clear ();
}
void intersect (basic_string_token &rhs_, basic_string_token &overlap_)