expression

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const AND = 57348
View Source
const IDENT = 57346
View Source
const OR = 57347
View Source
const WITH = 57349

Variables

View Source
var (
	ErrInvalidExpression = xerrors.New("invalid expression error")
)

Functions

func Normalize

func Normalize(license string, fn ...NormalizeFunc) (string, error)

func NormalizeForSPDX

func NormalizeForSPDX(s string) string

NormalizeForSPDX replaces ' ' to '-' in license-id. SPDX license MUST NOT be white space between a license-id. There MUST be white space on either side of the operator "WITH". ref: https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions

Types

type CompoundExpr

type CompoundExpr struct {
	// contains filtered or unexported fields
}

func (CompoundExpr) String

func (c CompoundExpr) String() string

type Expression

type Expression interface {
	String() string
}

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(reader io.Reader) *Lexer

func (*Lexer) Err

func (l *Lexer) Err() error

func (*Lexer) Error

func (l *Lexer) Error(e string)

func (*Lexer) Lex

func (l *Lexer) Lex(lval *yySymType) int

type NormalizeFunc

type NormalizeFunc func(license string) string

type SimpleExpr

type SimpleExpr struct {
	// contains filtered or unexported fields
}

func (SimpleExpr) String

func (s SimpleExpr) String() string

type Token

type Token struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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