MCPcopy Create free account
hub / github.com/dim-an/cod / Tokenize

Function Tokenize

shells/tokenize.go:46–60  ·  view source on GitHub ↗
(command string)

Source from the content-addressed store, hash-verified

44}
45
46func Tokenize(command string) (toks []Token, err error) {
47 t := tokenizer{
48 command: command,
49 reader: positionedScanner{
50 scanner: strings.NewReader(command),
51 pos: 0,
52 },
53 }
54 err = t.tokenize()
55 if err != nil {
56 return
57 }
58 toks = t.result
59 return
60}
61
62// http://man7.org/linux/man-pages/man1/bash.1.html#RESERVED_WORDS
63var reservedWords = map[string]bool{

Callers 3

ParseSimpleCommandFunction · 0.85
BashRemoveCompletionsFunction · 0.85
TestTokenizeStringsFunction · 0.85

Calls 1

tokenizeMethod · 0.95

Tested by 1

TestTokenizeStringsFunction · 0.68