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

Method string

utils/vscode/src/parser/parser.go:284–305  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

282// string processes the String token at the current position.
283// The lexer *must* know the next token is a String before calling.
284func (l *lexer) string() {
285 tok := &Token{Type: String, Range: Range{Start: l.pos, End: l.pos}}
286 if r := l.next(); r != '"' {
287 log.Fatalf("lexer expected '\"', got '%v'", r)
288 return
289 }
290 escape := false
291 for l.e == nil {
292 switch l.next() {
293 case '"':
294 if !escape {
295 tok.Range.End = l.pos
296 l.toks = append(l.toks, tok)
297 return
298 }
299 case '\\':
300 escape = !escape
301 default:
302 escape = false
303 }
304 }
305}
306
307// operator processes the Operator token at the current position.
308// The lexer *must* know the next token is a Operator before calling.

Callers 3

lexFunction · 0.95
OutputSourceFilesFunction · 0.80
mainFunction · 0.80

Calls 1

nextMethod · 0.95

Tested by

no test coverage detected