BasicLexer

- Calling `getTokens()` now returns a copy of the internal state
feature/mixins
Tristan B. V. Kildaire 2 months ago
parent 9314769ebf
commit e84845f2a0

@ -191,17 +191,17 @@ public final class BasicLexer : LexerInterface
} }
/** /**
* Exhaustively provide a list of all tokens * Exhaustively provide a list of all tokens.
* This will return a copy of the internal
* token array.
* *
* Returns: a `Token[]` containing all tokens * Returns: a `Token[]` containing all tokens
*/ */
public Token[] getTokens() public Token[] getTokens()
{ {
// todo: compute copy of `tokens` // return a copy
auto d = this.tokens.data(); auto d = this.tokens.data();
DEBUG("d_out: ", d); return d.dup;
// return tokens.data();
return d;
} }
/** /**

Loading…
Cancel
Save