package token
import "github.com/hashicorp/hcl/json/token"
Index ¶
- type Pos
- func (p Pos) After(u Pos) bool
- func (p Pos) Before(u Pos) bool
- func (p *Pos) IsValid() bool
- func (p Pos) String() string
- type Token
- type Type
Types ¶
type Pos ¶
type Pos struct { Filename string // filename, if any Offset int // offset, starting at 0 Line int // line number, starting at 1 Column int // column number, starting at 1 (character count) }
Pos describes an arbitrary source position including the file, line, and column location. A Position is valid if the line number is > 0.
func (Pos) After ¶
After reports whether the position p is after u.
func (Pos) Before ¶
Before reports whether the position p is before u.
func (*Pos) IsValid ¶
IsValid returns true if the position is valid.
func (Pos) String ¶
String returns a string in one of several forms:
file:line:column valid position with file name line:column valid position without file name file invalid position with file name - invalid position without file name
type Token ¶
Token defines a single HCL token which can be obtained via the Scanner
func (Token) HCLToken ¶
HCLToken converts this token to an HCL token.
The token type must be a literal type or this will panic.
func (Token) String ¶
String returns the token's literal text. Note that this is only applicable for certain token types, such as token.IDENT, token.STRING, etc..
type Type ¶
type Type int
Type is the set of lexical tokens of the HCL (HashiCorp Configuration Language)
const ( // Special tokens ILLEGAL Type = iota EOF NUMBER // 12345 FLOAT // 123.45 BOOL // true,false STRING // "abc" NULL // null LBRACK // [ LBRACE // { COMMA // , PERIOD // . COLON // : RBRACK // ] RBRACE // } )
func (Type) IsIdentifier ¶
IsIdentifier returns true for tokens corresponding to identifiers and basic type literals; it returns false otherwise.
func (Type) IsLiteral ¶
IsLiteral returns true for tokens corresponding to basic type literals; it returns false otherwise.
func (Type) IsOperator ¶
IsOperator returns true for tokens corresponding to operators and delimiters; it returns false otherwise.
func (Type) String ¶
String returns the string corresponding to the token tok.
Source Files ¶
- Version
- v1.0.1-vault-6
- Published
- Oct 30, 2024
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 4 hours ago –
Tools for package owners.