meta

package
v4.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 1 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Pos      Position
	Expected string
	Found    string
	// contains filtered or unexported fields
}

Error is the error type returned for all scanning/lexing/parsing related errors.

func (*Error) Error

func (e *Error) Error() string

func (*Error) SetOccured

func (e *Error) SetOccured(occuredIn string, occuredAt int)

SetOccured sets the file and the line number at which the error was raised (through runtime.Caller).

type Meta

type Meta struct {
	// Pos is the source position.
	Pos Position
	// LastPos is the last source position.
	// Currently it is set when the parsed element type is
	// syntax, package, comment, import, option, message, enum, oneof, rpc or service.
	LastPos Position
}

Meta represents a meta information about the parsed element.

type Position

type Position struct {
	// Filename is a name of file, if any
	Filename string
	// Offset is a byte offset, starting at 0
	Offset int
	// Line is a line number, starting at 1
	Line int
	// Column is a column number, starting at 1 (character count per line)
	Column int
}

Position represents a source position.

func (Position) String

func (pos Position) String() string

String stringify the position.

Jump to

Keyboard shortcuts

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