util

package
v1.9.33 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package util holds a few useful functions both for the forest package as well as for automation.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LuaMatchRx matches a lua-match predicate and it's corresponding pattern.
	LuaMatchRx = regexp.MustCompile(`#(?:not-)?lua-match\?.*?"(.*?)"\s*\)`)
)

Functions

func LuaPatternToGoRegexp added in v1.5.130

func LuaPatternToGoRegexp(pat []byte) (rx []byte)

LuaPatternToGoRegexp converts a Lua pattern to Go regexp.

func NormalizeLangPackName

func NormalizeLangPackName(langIn string) (lang, pack, silencer string)

NormalizeLangPackName normalizes the language and package names. Normally (in ~98% of the cases) the language, package and folder name are identical. In a few cases however, it is not (see the README).

func QueryLuaMatch2Match added in v1.5.130

func QueryLuaMatch2Match(content []byte) (out []byte)

QueryLuaMatch2Match converts all `lua-match?` and `not-lua-match?` predicates in a query with `match?` predicates and the corresponding Lua pattern to Go regexp. TODO: Implement verification? VerifyCount := bytes.Count(out, []byte("#lua-match? @")).

Types

This section is empty.

Jump to

Keyboard shortcuts

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