Documentation
¶
Overview ¶
Package token defines all the token kinds defined in the Protocol Buffers language version 3.
You can find the specification of the language in https://developers.google.com/protocol-buffers/docs/reference/proto3-spec.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
Kind identifies all possible token kinds.
const ( Illegal Kind = iota EOF Comment Identifier DecimalLiteral FloatLiteral HexLiteral OctalLiteral StringLiteral False True Enum Import Map Message Oneof Option Package Public Repeated Reserved Returns RPC Service Stream Syntax To Weak Bytes Double Float Bool Fixed32 Fixed64 Int32 Int64 Sfixed32 Sfixed64 Sint32 Sint64 String Uint32 Uint64 Dot // . Equals // = Minus // - Plus // + Comma // , Semicolon // ; OpenParen // ( CloseParen // ) OpenBrace // { CloseBrace // } OpenBracket // [ CloseBracket // ] OpenAngled // < CloseAngled // > )
func Keyword ¶
Keyword returns the Kind corresponding to the given text if it's a keyword. Otherwise it returns Illegal.
func Punctuation ¶
Type returns the Kind corresponding to the given text if it's a piece of punctuation. Otherwise it returns Illegal.
func Type ¶
Type returns the Kind corresponding to the given text if it's a type. Otherwise it returns Illegal.
func (Kind) IsConstant ¶
IsConstant returns true only if the given Kind is a constant.