flbconfig

package
v0.0.0-...-d88a328 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2018 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	RuneTab          = '\t'
	RuneSpace        = ' '
	RuneLeftBracket  = '['
	RuneRightBracket = ']'
	RuneNewLine      = '\n'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name     string    `json:"name"`
	Sections []Section `json:"sections"`
}

func Parse

func Parse(name, input string) (File, error)

type KeyValue

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Lexer

type Lexer struct {
	Input  string
	Tokens []Token
	State  StateFunc

	Start int
	Pos   int
}

func NewLexer

func NewLexer(input string) *Lexer

func (*Lexer) EOF

func (l *Lexer) EOF() bool

func (*Lexer) Emit

func (l *Lexer) Emit(tokenType TokenType)

func (*Lexer) Errorf

func (l *Lexer) Errorf(format string, args ...interface{}) StateFunc

func (*Lexer) Next

func (l *Lexer) Next() rune

func (*Lexer) PeekNext

func (l *Lexer) PeekNext() rune

func (*Lexer) Run

func (l *Lexer) Run()

type Section

type Section struct {
	Name      string     `json:"name"`
	KeyValues []KeyValue `json:"keyValuePairs"`
}

type StateFunc

type StateFunc func(*Lexer) StateFunc

func LexEOF

func LexEOF(l *Lexer) StateFunc

func LexGlobalWhiteSpace

func LexGlobalWhiteSpace(l *Lexer) StateFunc

func LexKey

func LexKey(l *Lexer) StateFunc

func LexKeyWhiteSpace

func LexKeyWhiteSpace(l *Lexer) StateFunc

func LexLeftBracket

func LexLeftBracket(l *Lexer) StateFunc

func LexNewLine

func LexNewLine(l *Lexer) StateFunc

func LexRightBracket

func LexRightBracket(l *Lexer) StateFunc

func LexSection

func LexSection(l *Lexer) StateFunc

func LexStart

func LexStart(l *Lexer) StateFunc

func LexValue

func LexValue(l *Lexer) StateFunc

type Token

type Token struct {
	Type  TokenType
	Value string
}

type TokenType

type TokenType int
const (
	TokenError TokenType = iota
	TokenEOF
	TokenNewLine

	TokenLeftBracket
	TokenRightBracket

	TokenSection
	TokenKey
	TokenValue
)

Jump to

Keyboard shortcuts

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