summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorayyansea <ayyansea@gmail.com>2024-12-03 22:34:26 +0300
committerayyansea <ayyansea@gmail.com>2024-12-03 22:34:26 +0300
commit0f8c056b1214dab67d7cdfe236747e1507b9bd6d (patch)
tree8f7038c6f5a54dd227f94f913aad17f790ba51f8
parent27489dc5043fbd04c628e62d4df9a98cb53d8b06 (diff)
feat: add Clear() method to LinkedTokenList
-rw-r--r--internal/token/linked_token_list.go5
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,