parsepasses

package
v0.0.0-...-4dafff4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package parsepasses contains routines that validate or rewrite a Soy AST.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDataRefs

func CheckDataRefs(reg template.Registry) (err error)

CheckDataRefs validates that:

  1. all data refs are provided by @params or {let} nodes (except $ij)
  2. any data declared as a @param is used by the template (or passed via {call})
  3. all {call} params are declared as @params in the called template soydoc.
  4. a {call}'ed template is passed all required @params, or a data="$var"
  5. {call}'d templates actually exist in the registry.
  6. any variable created by {let} is used somewhere
  7. {let} variable names are valid. ('ij' is not allowed.)

func ProcessMessages

func ProcessMessages(reg template.Registry)

ProcessMessages calculates the message ids and placeholder names for {msg} nodes and sets that information on the node.

func SetGlobals

func SetGlobals(reg template.Registry, globals data.Map) error

SetGlobals sets the value of all global nodes in the given registry. An error is returned if any globals were left undefined.

func SetNodeGlobals

func SetNodeGlobals(node ast.Node, globals data.Map) error

SetNodeGlobals sets global values on the given node and all children nodes, using the given data map. An error is returned if any global nodes were left undefined.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL