708abb8c97
This is a super-invasive update since the "zcl" package in particular is referenced all over. There are probably still a few zcl references hanging around in comments, etc but this takes care of most of it.
21 lines
568 B
Go
21 lines
568 B
Go
package hcled
|
|
|
|
import (
|
|
"github.com/hashicorp/hcl2/hcl"
|
|
)
|
|
|
|
type contextStringer interface {
|
|
ContextString(offset int) string
|
|
}
|
|
|
|
// ContextString returns a string describing the context of the given byte
|
|
// offset, if available. An empty string is returned if no such information
|
|
// is available, or otherwise the returned string is in a form that depends
|
|
// on the language used to write the referenced file.
|
|
func ContextString(file *hcl.File, offset int) string {
|
|
if cser, ok := file.Nav.(contextStringer); ok {
|
|
return cser.ContextString(offset)
|
|
}
|
|
return ""
|
|
}
|