Documentation ¶
Index ¶
- Variables
- func CanonicaliseURI(parent string, child string) string
- func DecodeURIFromQuery(uri string) (string, error)
- func FirstToken(node phrase.AstNode) *lexer.Token
- func GetURIID(uri string) string
- func HandleError(err error)
- func IsOfPhraseType(node phrase.AstNode, phraseType phrase.PhraseType) (*phrase.Phrase, bool)
- func IsOfPhraseTypes(node phrase.AstNode, phraseTypes []phrase.PhraseType) (*phrase.Phrase, bool)
- func IsURINavigatable(uri string) bool
- func LastToken(node phrase.AstNode) *lexer.Token
- func PathToURI(path string) string
- func PrintMemUsage()
- func RunesToUTF8(rs []rune) []byte
- func SetFromArray[V comparable](arr []V) mapset.Set[V]
- func TimeTrack(start time.Time, name string)
- func URIFromCanonicalURI(parent string, canonicalURI string) string
- func URIToPath(uri string) (string, error)
- type NodeStack
- func (s *NodeStack) Parent() phrase.Phrase
- func (s *NodeStack) Phrase() phrase.Phrase
- func (s *NodeStack) Pop() *phrase.Phrase
- func (s *NodeStack) Push(node *phrase.Phrase)
- func (s *NodeStack) SetParents(parents []*phrase.Phrase) *NodeStack
- func (s *NodeStack) SetToken(token *lexer.Token) *NodeStack
- func (s NodeStack) String() string
- func (s NodeStack) Token() lexer.Token
- type Traverser
- func (s *Traverser) Advance() phrase.AstNode
- func (s *Traverser) Ascend() (*Traverser, error)
- func (s *Traverser) Clone() *Traverser
- func (s *Traverser) Descend() (*Traverser, error)
- func (s *Traverser) Peek() phrase.AstNode
- func (s *Traverser) SkipToken(tokenType lexer.TokenType)
- func (s *Traverser) Traverse(visit Visitor)
- type Visitor
- type VisitorContext
Constants ¶
This section is empty.
Variables ¶
var ShowTimeTrack = false
ShowTimeTrack controls if TimeTrack should be logged
Functions ¶
func CanonicaliseURI ¶
CanonicaliseURI canonicalises a child URI by shorten it assuming that it is prefixed with parent, otherwise the original URI is returned
func DecodeURIFromQuery ¶
func FirstToken ¶
FirstToken returns the first terminal node (leave)
func HandleError ¶
func HandleError(err error)
func IsOfPhraseType ¶
IsOfPhraseType checks if a node is the given type
func IsOfPhraseTypes ¶
IsOfPhraseTypes checks if a node is one of the given types
func IsURINavigatable ¶
IsURINavigatable checks if the given URI is navigatable
func PrintMemUsage ¶
func PrintMemUsage()
PrintMemUsage outputs the current, total and OS memory being used. As well as the number of garage collection cycles completed.
func RunesToUTF8 ¶
RunesToUTF8 converts []rune to []byte without converting to string first
func SetFromArray ¶ added in v0.0.2
func SetFromArray[V comparable](arr []V) mapset.Set[V]
func TimeTrack ¶
TimeTrack tracks the time Example: `defer util.TimeTrack(time.Now(), "An example")`
func URIFromCanonicalURI ¶
URIFromCanonicalURI converts canonical URI back to full URI, if the canonical URI is a full URI which is prefixed with parent then it is returned
Types ¶
type NodeStack ¶
type NodeStack struct {
// contains filtered or unexported fields
}
NodeStack contains the token and its parents
func (*NodeStack) SetParents ¶
SetParents sets the parents of the stack
type Traverser ¶
type Traverser struct {
// contains filtered or unexported fields
}