terminal

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: MPL-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Package terminal contains basic terminal parsers for text parsing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(trueStr string, falseStr string) *parser.NamedFunc

Bool matches a bool literal: true or false

func Char

func Char() *parser.NamedFunc

Char matches a character literal enclosed in single quotes

func Float

func Float() *parser.NamedFunc

Float matches a float literal

func Integer

func Integer() *parser.NamedFunc

Integer matches all integer numbers and zero with an optional -/+ sign

func Nil added in v0.6.0

func Nil(nilStr string) *parser.NamedFunc

Nil matches a nil literal

func Regexp

func Regexp(token string, name string, regexp string, groupIndex int) *parser.NamedFunc

Regexp matches the given regular expression The name variable is used for error messages, so it should be descriptive and make sense in the sentence "was expecting %s". The includeWhitespaces variable should be true if the reader is by default ignoring the whitespaces but you need to match those as well. If you are using capturing groups you can select which group to use as a value with the groupIdex variable.

func Rune

func Rune(ch rune) *parser.NamedFunc

Rune matches the given character

func String

func String(allowBackquote bool) *parser.NamedFunc

String matches a string literal enclosed in double quotes

func Substring added in v0.6.0

func Substring(token string, str string, value interface{}) *parser.NamedFunc

Substring matches the given string

func Whitespaces added in v0.6.0

func Whitespaces(wsMode text.WsMode) parsley.Parser

Whitespaces matches one or more spaces or tabs. If newLine is true it also matches \n and \f characters.

func Word

func Word(word string, value interface{}) *parser.NamedFunc

Word matches the given word

Types

This section is empty.

Jump to

Keyboard shortcuts

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