MCPcopy Index your code
hub / github.com/idank/explainshell / visitreservedword

Method visitreservedword

explainshell/matcher.py:185–202  ·  view source on GitHub ↗
(self, node, word)

Source from the content-addressed store, hash-verified

183 return MatchResult(start, end, None, None, {"kind": "unknown"})
184
185 def visitreservedword(self, node, word):
186 # first try the compound reserved words
187 helptext = None
188 if self.compound_stack:
189 current_compound = self.compound_stack[-1]
190 helptext = help_constants.COMPOUND_RESERVED_WORDS.get(
191 current_compound, {}
192 ).get(word)
193
194 # try these if we don't have anything specific
195 if not helptext:
196 helptext = help_constants.RESERVED_WORDS[word]
197
198 self.groups[0].results.append(
199 MatchResult(
200 node.pos[0], node.pos[1], helptext, None, {"kind": "reserved_word"}
201 )
202 )
203
204 def visitoperator(self, node, op):
205 helptext = None

Callers

nothing calls this directly

Calls 1

MatchResultClass · 0.85

Tested by

no test coverage detected