Skip to content

Commit

Permalink
Add reset Method On Parser (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoolwinter authored Sep 3, 2024
1 parent f46c79e commit 46fc7e9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/SwiftTreeSitter/Parser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ extension Parser {
}
}

/// Resets the parser to begin at the beginning of the document.
///
/// If the parser was cancelled or timed out, use this to reset it.
public func reset() {
ts_parser_reset(internalParser)
}

/// The ranges this parser will operate on.
///
/// This defaults to the entire document. This is useful for working with embedded languages.
Expand Down

0 comments on commit 46fc7e9

Please sign in to comment.