...

Package scanner

import "github.com/hashicorp/hcl/hcl/scanner"
Overview
Index

Overview ▾

Package scanner implements a scanner for HCL (HashiCorp Configuration Language) source text.

type Scanner

Scanner defines a lexical scanner

type Scanner struct {

    // Error is called for each error encountered. If no Error
    // function is set, the error is reported to os.Stderr.
    Error func(pos token.Pos, msg string)

    // ErrorCount is incremented by one for each error encountered.
    ErrorCount int
    // contains filtered or unexported fields
}

func New

func New(src []byte) *Scanner

New creates and initializes a new instance of Scanner using src as its source content.

func (*Scanner) Scan

func (s *Scanner) Scan() token.Token

Scan scans the next token and returns the token.