opa: github.com/open-policy-agent/opa/ast/internal/tokens Index | Files

package tokens

import "github.com/open-policy-agent/opa/ast/internal/tokens"

Index

Package Files

tokens.go

type Token Uses

type Token int

Token represents a single Rego source code token for use by the Parser.

const (
    Illegal Token = iota
    EOF
    Whitespace
    Ident
    Comment

    Package
    Import
    As
    Default
    Else
    Not
    Some
    With
    Null
    True
    False

    Number
    String

    LBrack
    RBrack
    LBrace
    RBrace
    LParen
    RParen
    Comma
    Colon

    Add
    Sub
    Mul
    Quo
    Rem
    And
    Or
    Unify
    Equal
    Assign
    Neq
    Gt
    Lt
    Gte
    Lte
    Dot
    Semicolon
)

All tokens must be defined here

func Keyword Uses

func Keyword(lit string) Token

Keyword will return a token for the passed in literal value. If the value is a Rego keyword then the appropriate token is returned. Everything else is an Ident.

func (Token) String Uses

func (t Token) String() string

Package tokens is imported by 2 packages. Updated 2020-03-26. Refresh now. Tools for package owners.