Documentation
¶
Overview ¶
Package scriptreserved answers one question about a Starlark parse error: is it a reserved word used as a name, and if so which word (#1823)?
The parser's message at "def load(...)" is "not an identifier", reported at the token after the word, which is true and names neither the word nor the mistake. This package finds the word from the error and the source line, so the validator can say which word it was and what to do about it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Misused ¶
Misused reports the reserved word a parse error is about, or false when the error is about something else.
There are three shapes: the word where a name is declared (a def, a parameter, an attribute), where the parser says "not an identifier" at the token after it; the word where a value is read, which the parser names; and "load" at the start of an assignment, which the parser takes for the load statement and answers with the parenthesis it wanted.
Types ¶
This section is empty.