diff options
| author | ayyansea <ayyansea@gmail.com> | 2024-12-03 22:34:26 +0300 |
|---|---|---|
| committer | ayyansea <ayyansea@gmail.com> | 2024-12-03 22:34:26 +0300 |
| commit | 0f8c056b1214dab67d7cdfe236747e1507b9bd6d (patch) | |
| tree | 8f7038c6f5a54dd227f94f913aad17f790ba51f8 /internal/token | |
| parent | 27489dc5043fbd04c628e62d4df9a98cb53d8b06 (diff) | |
feat: add Clear() method to LinkedTokenList
Diffstat (limited to 'internal/token')
| -rw-r--r-- | internal/token/linked_token_list.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/token/linked_token_list.go b/internal/token/linked_token_list.go index 5115f75..b36f170 100644 --- a/internal/token/linked_token_list.go +++ b/internal/token/linked_token_list.go @@ -12,6 +12,11 @@ func (lts *LinkedTokenList) GetTail() *Token { return lts.tail } +func (lts *LinkedTokenList) Clear() { + lts.head = nil + lts.tail = nil +} + func (lts *LinkedTokenList) AddToken(content string) { newToken := &Token{ content: content, |
