Documentation ¶
Index ¶
- func BashParseFunc() parser.Func
- func BenchmarkParser(b *testing.B, f parser.Func, path string)
- func CParseFunc() parser.Func
- func CriticMarkupParseFunc() parser.Func
- func FuzzParser(f *testing.F, parseFunc parser.Func, seeds []string)
- func GitCommitParseFunc() parser.Func
- func GitRebaseParseFunc() parser.Func
- func GoTemplateParseFunc() parser.Func
- func GolangParseFunc() parser.Func
- func JsonParseFunc() parser.Func
- func LoadFuzzTestSeeds(f *testing.F, globPattern string) []string
- func MakefileParseFunc() parser.Func
- func MarkdownParseFunc() parser.Func
- func P4ParseFunc() parser.Func
- func ProtobufParseFunc() parser.Func
- func PythonParseFunc() parser.Func
- func RustParseFunc() parser.Func
- func TodoTxtParseFunc() parser.Func
- func XmlParseFunc() parser.Func
- func YamlParseFunc() parser.Func
- type TokenWithText
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BashParseFunc ¶ added in v1.0.0
BashParseFunc returns a parse func for bash. See https://www.gnu.org/software/bash/manual/bash.html
Some known limitations with this implementation: * reserved keywords "in" and "do" recognized outside the context of a case/select/for. * no special parsing for numbers or arithmetic expressions $((...)) * no special handling for file redirects after heredoc word.
func BenchmarkParser ¶ added in v1.0.0
BenchmarkParser benchmarks a parser with the input file located at `path`.
func CParseFunc ¶
CParseFunc returns a parse func for C99 with GNU extensions. See "The GNU C Reference Manual" http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Lexical-Elements and "The C Preprocessor" http://gcc.gnu.org/onlinedocs/cpp/
func CriticMarkupParseFunc ¶ added in v0.7.0
CriticMarkupParseFunc returns a parse func for CriticMarkup. https://github.com/CriticMarkup/CriticMarkup-toolkit/blob/master/README.md
func FuzzParser ¶ added in v1.0.0
FuzzParser runs a fuzz test on a parser.
func GitCommitParseFunc ¶
GitCommitParseFunc parses a git commit.
func GitRebaseParseFunc ¶
GitRebaseParseFunc parses a git rebase.
func GoTemplateParseFunc ¶ added in v0.7.0
GoTemplateParseFunc returns a parse func for Go templates. See https://pkg.go.dev/text/template
func GolangParseFunc ¶
GolangParseFunc returns a parse func for Go. See "The Go Programming Language Specification" https://golang.org/ref/spec
func LoadFuzzTestSeeds ¶ added in v1.0.0
LoadFuzzTestSeeds loads seed data from files matching a glob pattern.
func MakefileParseFunc ¶ added in v1.2.0
MakefileParseFunc returns a parse func for GNU Makefiles. See https://www.gnu.org/software/make/manual/make.html especially section 3.8 "How Makefiles are Parsed"
func MarkdownParseFunc ¶ added in v0.6.0
MarkdownParseFunc returns a parse func for Markdown. This attempts to follow the CommonMark 0.30 spec, but deviates in some cases to simplify the implementation.
Known limitations include: * Incorrect handling of nested emphasis in some cases. * No support for inline HTML. * No support for autolinks. * No support for indented code blocks. * No support for block quotes. * No support for entity and numeric character references. * Some differences in handling of nested lists. * Some differences in handling link and code span precedence. * No restriction on the number of digits in a list item. * No restriction on indentation for lists, code fences, headings, etc.
See https://spec.commonmark.org/0.30/ for details.
func P4ParseFunc ¶ added in v1.3.0
P4ParseFunc returns a parse func for P4-16. See https://p4.org/p4-spec/docs/P4-16-v1.0.0-spec.html for the spec. See also p4.json for syntax highlighting rules: https://github.com/p4lang/p4-spec/blob/c84896fcd87f940983648b185ef9acf2b6f14838/p4-16/spec/p4.json
func ProtobufParseFunc ¶ added in v0.5.0
Protocol Buffers Version 3 See "Protocol Buffers Version 3 Language Specification" https://developers.google.com/protocol-buffers/docs/reference/proto3-spec
func PythonParseFunc ¶
PythonParseFunc returns a parse func for Python. See "The Python Language Reference" https://docs.python.org/3/reference/
func RustParseFunc ¶
RustParseFunc returns a parse func for Rust. See "The Rust Reference" https://doc.rust-lang.org/stable/reference/
func TodoTxtParseFunc ¶ added in v0.6.0
TodoTxtParseFunc returns a parse func for the todo.txt file format. See https://github.com/todotxt/todo.txt for details.
func XmlParseFunc ¶ added in v1.0.0
XmlParseFunc returns a parse func for XML. See https://www.w3.org/TR/2006/REC-xml11-20060816/
Types ¶
type TokenWithText ¶
TokenWithText is a token that includes its text value.
func ParseTokensWithText ¶
func ParseTokensWithText(f parser.Func, s string) []TokenWithText
ParseTokensWithText tokenizes the input string using the specified parse func.