asHCLSyntax returns the receiver expressed as an incomplete hclsyntax.Token. A complete token is not possible since we don't have source location information here, and so this method is unexported so we can be sure it will only be used for internal purposes where we know the range isn't important.
()
| 34 | // This is primarily intended to allow us to re-use certain functionality from |
| 35 | // hclsyntax rather than re-implementing it against our own token type here. |
| 36 | func (t *Token) asHCLSyntax() hclsyntax.Token { |
| 37 | return hclsyntax.Token{ |
| 38 | Type: t.Type, |
| 39 | Bytes: t.Bytes, |
| 40 | Range: hcl.Range{ |
| 41 | Filename: "<invalid>", |
| 42 | }, |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // Tokens is a flat list of tokens. |
| 47 | type Tokens []*Token |
no outgoing calls
no test coverage detected