LexExpression performs lexical analysis on the given buffer, treating it as a standalone HCL expression, 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
(src []byte, filename string, start hcl.Pos)
| 170 | // encodings or unrecognized characters, but full parsing is required to |
| 171 | // detect _all_ syntax errors. |
| 172 | func LexExpression(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { |
| 173 | // This is actually just the same thing as LexConfig, since configs |
| 174 | // and expressions lex in the same way. |
| 175 | tokens := scanTokens(src, filename, start, scanNormal) |
| 176 | diags := checkInvalidTokens(tokens) |
| 177 | return tokens, diags |
| 178 | } |
| 179 | |
| 180 | // LexTemplate performs lexical analysis on the given buffer, treating it as a |
| 181 | // standalone HCL template, and returns the resulting tokens. |
no test coverage detected