lexerql

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package lexerql provides utilities for lexing in *QL languages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDigit

func IsDigit[R char](r R) bool

IsDigit returns true, if r is an ASCII digit.

func IsDurationRune

func IsDurationRune[R char](r R) bool

IsDurationRune returns true, if r is a non-digit rune that could be part of duration.

func IsIdentRune

func IsIdentRune[R char](r R) bool

IsIdentRune returns true, if r is a valid character of Go identifier/Prometheus label.

func IsIdentStartRune

func IsIdentStartRune[R char](r R) bool

IsIdentStartRune returns true, if r is a valid first character of Go identifier/Prometheus label.

func IsLetter

func IsLetter[R char](r R) bool

IsLetter returns true, if r is an ASCII letter.

func ParseDuration

func ParseDuration(s string) (time.Duration, error)

ParseDuration parses Prometheus or Go duration

func ScanComment

func ScanComment(s *scanner.Scanner)

ScanComment reads runes until newline.

func ScanDuration

func ScanDuration(s *scanner.Scanner, number string) (string, error)

ScanDuration scans and parses duration from given scanner.

Types

This section is empty.

Jump to

Keyboard shortcuts

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