xo-tokenizer: example tokenrepl restored to wokring order
Now with CBufferedInput in Tokenizer
This commit is contained in:
parent
5e771a99ec
commit
94e02f0eeb
4 changed files with 27 additions and 18 deletions
|
|
@ -39,8 +39,8 @@ namespace xo {
|
|||
using size_type = std::size_t;
|
||||
using byte = std::byte;
|
||||
/** a contiguous addres range **/
|
||||
using span_type = span<byte>;
|
||||
using const_span_type = span<const byte>;
|
||||
using span_type = span<char>;
|
||||
using const_span_type = span<const char>;
|
||||
|
||||
///@}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ namespace xo {
|
|||
*
|
||||
* Require: @p hi < @ref reserved_range_.hi
|
||||
**/
|
||||
bool _expand_to(byte * hi);
|
||||
bool _expand_to(char * hi);
|
||||
|
||||
/** shrink occupied rnage to the smallest contiguous range that contains both:
|
||||
* all of .input_range_, and all pinned ranges in .pinned_spans_
|
||||
|
|
|
|||
|
|
@ -88,6 +88,14 @@ namespace xo {
|
|||
return span(lo, hi);
|
||||
}
|
||||
|
||||
/** @brief create span from raw memory **/
|
||||
static span from_memory(span<std::byte> span_memory) {
|
||||
CharT * lo = (CharT *)span_memory.lo();
|
||||
CharT * hi = (CharT *)span_memory.hi();
|
||||
|
||||
return span(lo, hi);
|
||||
}
|
||||
|
||||
/** @brief concatenate two contiguous spans */
|
||||
static span concat(const span & span1, const span & span2) {
|
||||
if (span1.is_null())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue