MCPcopy Create free account
hub / github.com/microsoft/typescript-go / rewind

Method rewind

internal/parser/parser.go:364–374  ·  view source on GitHub ↗
(state ParserState)

Source from the content-addressed store, hash-verified

362}
363
364func (p *Parser) rewind(state ParserState) {
365 p.scanner.Rewind(state.scannerState)
366 p.token = p.scanner.Token()
367 p.contextFlags = state.contextFlags
368 p.diagnostics = p.diagnostics[0:state.diagnosticsLen]
369 p.jsDiagnostics = p.jsDiagnostics[0:state.jsDiagnosticsLen]
370 p.jsdocInfos = p.jsdocInfos[0:state.jsdocInfosLen]
371 p.reparsedClones = p.reparsedClones[0:state.reparsedClonesLen]
372 p.statementHasAwaitIdentifier = state.statementHasAwaitIdentifier
373 p.hasParseError = state.hasParseError
374}
375
376func (p *Parser) lookAhead(callback func(p *Parser) bool) bool {
377 state := p.mark()

Calls 2

RewindMethod · 0.80
TokenMethod · 0.80

Tested by

no test coverage detected