MCPcopy
hub / github.com/google/go-jsonnet / SnippetToRawAST

Function SnippetToRawAST

internal/parser/parser.go:1404–1410  ·  view source on GitHub ↗

SnippetToRawAST converts a Jsonnet code snippet to an AST (without any transformations). Any fodder after the final token is returned as well.

(diagnosticFilename ast.DiagnosticFileName, importedFilename, snippet string)

Source from the content-addressed store, hash-verified

1402// SnippetToRawAST converts a Jsonnet code snippet to an AST (without any transformations).
1403// Any fodder after the final token is returned as well.
1404func SnippetToRawAST(diagnosticFilename ast.DiagnosticFileName, importedFilename, snippet string) (ast.Node, ast.Fodder, error) {
1405 tokens, err := Lex(diagnosticFilename, importedFilename, snippet)
1406 if err != nil {
1407 return nil, nil, err
1408 }
1409 return Parse(tokens)
1410}

Callers 4

runInternalJsonnetFunction · 0.92
SnippetToASTFunction · 0.92
FormatFunction · 0.92
SnippetToRawASTFunction · 0.92

Calls 2

LexFunction · 0.85
ParseFunction · 0.85

Tested by 1

runInternalJsonnetFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…