LexTemplate performs lexical analysis on the given buffer, treating it as a standalone HCL template, and returns the resulting tokens. Only minimal validation is done during lexical analysis, so the returned diagnostics may include errors about lexical issues such as bad character encodings or unre
(src []byte, filename string, start hcl.Pos)
| 185 | // encodings or unrecognized characters, but full parsing is required to |
| 186 | // detect _all_ syntax errors. |
| 187 | func LexTemplate(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { |
| 188 | tokens := scanTokens(src, filename, start, scanTemplate) |
| 189 | diags := checkInvalidTokens(tokens) |
| 190 | return tokens, diags |
| 191 | } |
| 192 | |
| 193 | // ValidIdentifier tests if the given string could be a valid identifier in |
| 194 | // a native syntax expression. |
no test coverage detected