mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 10:15:36 +00:00
* Update package version * Update makefile targets * Update readme packages * Remaining old packages via rg/sd
17 lines
459 B
Go
17 lines
459 B
Go
package dsl
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/johnkerl/miller/v6/pkg/parsing/token"
|
|
)
|
|
|
|
// TokenToLocationInfo is used to track runtime errors back to source-code locations in DSL
|
|
// expressions, so we can have more informative error messages.
|
|
func TokenToLocationInfo(sourceToken *token.Token) string {
|
|
if sourceToken == nil {
|
|
return ""
|
|
} else {
|
|
return fmt.Sprintf(" at DSL expression line %d column %d", sourceToken.Pos.Line, sourceToken.Pos.Column)
|
|
}
|
|
}
|