terminal

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 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() parser.Func

Bool matches a bool literal: true or false

func Char

func Char() parser.Func

Char matches a character literal enclosed in single quotes

func Float

func Float() parser.Func

Float matches a float literal

func Integer

func Integer() parser.Func

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

func Regexp

func Regexp(desc string, regexp string, includeWhitespaces bool, groupIndex int, token string) parser.Func

Regexp matches the given regular expression The desc 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(char rune, token string) parser.Func

Rune matches the given character

func String

func String() parser.Func

String matches a string literal enclosed in double quotes

func Word

func Word(word string, token string, value interface{}) parser.Func

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