Documentation ¶
Overview ¶
Packages asts contains utilities for constructing and manipulating ASTs.
Index ¶
- func BraceText(depth int, ss ...interface{}) *ast.ParsedText
- func BraceTextExpr(depth int, ss ...ast.Expr) *ast.ParsedText
- func Comma() *ast.TextComma
- func Concat(x, y ast.Expr) ast.Expr
- func Escaped(c rune) *ast.TextEscaped
- func ExprString(x ast.Expr) string
- func Ident(s string) ast.Expr
- func Macro(name string, params ...interface{}) *ast.TextMacro
- func Math(x string) *ast.TextMath
- func NBSP() *ast.TextNBSP
- func ParseAny(s interface{}) ast.Expr
- func ParseStringExpr(depth int, s string) ast.Expr
- func QuotedText(depth int, ss ...string) *ast.ParsedText
- func QuotedTextExpr(depth int, ss ...ast.Expr) *ast.ParsedText
- func Space() *ast.TextSpace
- func Text(s string) *ast.Text
- func UnparsedBraceText(s string) *ast.UnparsedText
- func UnparsedText(s string) ast.Expr
- func WithBibKeys(ts ...string) func(decl *ast.BibDecl)
- func WithBibTags(key string, val ast.Expr, rest ...interface{}) func(decl *ast.BibDecl)
- func WithBibType(s string) func(decl *ast.BibDecl)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BraceText ¶
func BraceText(depth int, ss ...interface{}) *ast.ParsedText
BraceTextExpr returns parsed text delimited by braces. Uses the following strategies to convert each string into a text expression:
- If the string is all whitespace, convert to ast.TextSpace.
- If the string begins and ends with '$', convert to ast.TextMath.
- If the string begins with '{' and ends with '}', convert to brace text recursively by removing the braces and splitting on space.
- If the string is ',', convert to ast.TextComma.
- If the string begins with '\' and has an alphabetical char, convert to command ast.TextMacro.
- Otherwise, convert to ast.Text.
func BraceTextExpr ¶
func BraceTextExpr(depth int, ss ...ast.Expr) *ast.ParsedText
BraceTextExpr return parsed text delimited by braces.
func Escaped ¶
func Escaped(c rune) *ast.TextEscaped
func ExprString ¶
func QuotedText ¶
func QuotedText(depth int, ss ...string) *ast.ParsedText
QuotedText returns parsed text delimited by braces. Uses the following strategies to convert each string into a text expression:
- If the string is all whitespace, convert to ast.TextSpace.
- If the string begins and ends with '$', convert to ast.TextMath.
- If the string begins with '{' and ends with '}', convert to brace text recursively by removing the braces and splitting on space.
- If the string is ',', convert to ast.TextComma.
- Otherwise, convert to ast.Text.
func QuotedTextExpr ¶
func QuotedTextExpr(depth int, ss ...ast.Expr) *ast.ParsedText
QuotedTextExpr return parsed text delimited by quotes.
func UnparsedBraceText ¶
func UnparsedBraceText(s string) *ast.UnparsedText
func UnparsedText ¶
func WithBibKeys ¶
func WithBibTags ¶
func WithBibType ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.