TokensForIdentifier returns a sequence of tokens representing just the given identifier. In practice this function can only ever generate exactly one token, because an identifier is always a leaf token in the syntax tree. This is similar to calling TokensForTraversal with a single-step absolute tr
(name string)
| 53 | // for this simple common case. If you need to generate a multi-step traversal, |
| 54 | // use TokensForTraversal instead. |
| 55 | func TokensForIdentifier(name string) Tokens { |
| 56 | return Tokens{ |
| 57 | newIdentToken(name), |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // TokensForTuple returns a sequence of tokens that represents a tuple |
| 62 | // constructor, with element expressions populated from the given list |