MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / lineComment

Method lineComment

utils/vscode/src/parser/parser.go:323–339  ·  view source on GitHub ↗

lineComment processes the Comment token at the current position. The lexer *must* know the next token is a Comment before calling.

()

Source from the content-addressed store, hash-verified

321// lineComment processes the Comment token at the current position.
322// The lexer *must* know the next token is a Comment before calling.
323func (l *lexer) lineComment() {
324 tok := &Token{Type: Comment, Range: Range{Start: l.pos, End: l.pos}}
325 if r := l.next(); r != ';' {
326 log.Fatalf("lexer expected ';', got '%v'", r)
327 return
328 }
329 for l.e == nil {
330 s := l.save()
331 switch l.next() {
332 case '\n':
333 l.restore(s)
334 tok.Range.End = l.pos
335 l.toks = append(l.toks, tok)
336 return
337 }
338 }
339}
340
341// newline processes the Newline token at the current position.
342// The lexer *must* know the next token is a Newline before calling.

Callers 1

lexFunction · 0.95

Calls 3

nextMethod · 0.95
saveMethod · 0.95
restoreMethod · 0.95

Tested by

no test coverage detected