diff --git a/include/xo/tokenizer/span.hpp b/include/xo/tokenizer/span.hpp index 36353a63..00f8cf74 100644 --- a/include/xo/tokenizer/span.hpp +++ b/include/xo/tokenizer/span.hpp @@ -93,6 +93,16 @@ namespace xo { /** @brief report the number of elements (of type CharT) in this span. **/ size_type size() const { return hi_ - lo_; } + span & operator+=(const span & x) { + if (hi_ == x.lo_) { + hi_ = x.hi_; + } else { + assert(false); + } + + return *this; + } + /** print representation for this span on stream @p os **/ void print(std::ostream & os) const { os << "