MCPcopy
hub / github.com/tinylib/msgp / applyEarlyDirectives

Method applyEarlyDirectives

parse/getast.go:162–181  ·  view source on GitHub ↗

applyEarlyDirectives applies all early directives needed before process() is called. additional directives remain in f.Directives for future processing

()

Source from the content-addressed store, hash-verified

160// applyEarlyDirectives applies all early directives needed before process() is called.
161// additional directives remain in f.Directives for future processing
162func (fs *FileSet) applyEarlyDirectives() {
163 newdirs := make([]string, 0, len(fs.Directives))
164 for _, d := range fs.Directives {
165 parts := strings.Split(d, " ")
166 if len(parts) == 0 {
167 continue
168 }
169 if fn, ok := earlyDirectives[parts[0]]; ok {
170 pushstate(parts[0])
171 err := fn(parts, fs)
172 if err != nil {
173 warnf("early directive error: %s", err)
174 }
175 popstate()
176 } else {
177 newdirs = append(newdirs, d)
178 }
179 }
180 fs.Directives = newdirs
181}
182
183// A linkset is a graph of unresolved
184// identities.

Callers 1

FileFunction · 0.95

Calls 3

pushstateFunction · 0.85
warnfFunction · 0.85
popstateFunction · 0.85

Tested by

no test coverage detected