xo-tokenizer: doc: ++ comments
This commit is contained in:
parent
ec7d50f052
commit
52b522c8b1
1 changed files with 8 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ namespace xo {
|
||||||
* span_type input = ...;
|
* span_type input = ...;
|
||||||
*
|
*
|
||||||
* while !input.empty() {
|
* while !input.empty() {
|
||||||
* auto res = tkz.assemble_scan(input);
|
* auto res = tkz.scan(input);
|
||||||
* const auto & tk = res.first;
|
* const auto & tk = res.first;
|
||||||
*
|
*
|
||||||
* // do something with tk if tk.is_valid()
|
* // do something with tk if tk.is_valid()
|
||||||
|
|
@ -75,7 +75,12 @@ namespace xo {
|
||||||
**/
|
**/
|
||||||
token_type assemble_token(const span_type & token_text) const;
|
token_type assemble_token(const span_type & token_text) const;
|
||||||
|
|
||||||
/** scan for next input token, given @p input **/
|
/** scan for next input token, given @p input.
|
||||||
|
* Note tokenizer can consume input (e.g. whitespace)
|
||||||
|
* without completing a token
|
||||||
|
*
|
||||||
|
* @return {parsed token, consumed span}
|
||||||
|
**/
|
||||||
scan_result scan(const span_type & input);
|
scan_result scan(const span_type & input);
|
||||||
|
|
||||||
/** notify end of input, resolve any stored input **/
|
/** notify end of input, resolve any stored input **/
|
||||||
|
|
@ -568,7 +573,7 @@ namespace xo {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!complete_flag) {
|
if (!complete_flag) {
|
||||||
/* need more input to know if/when tokken complete */
|
/* need more input to know if/when token complete */
|
||||||
this->prefix_ += std::string(tk_start, input.hi());
|
this->prefix_ += std::string(tk_start, input.hi());
|
||||||
|
|
||||||
log && log(xtag("captured-prefix", this->prefix_));
|
log && log(xtag("captured-prefix", this->prefix_));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue