internal

package
v1.29.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Copyright (c) 2021 Uber Technologies, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const BINARY = 57362
View Source
const BOOL = 57354
View Source
const BYTE = 57355
View Source
const CONST = 57375
View Source
const CPP_INCLUDE = 57352
View Source
const DOUBLE = 57360
View Source
const DUBCONSTANT = 57349
View Source
const ENUM = 57374
View Source
const EXCEPTION = 57370
View Source
const EXTENDS = 57371
View Source
const FALSE = 57379
View Source
const I16 = 57357
View Source
const I32 = 57358
View Source
const I64 = 57359
View Source
const I8 = 57356
View Source
const IDENTIFIER = 57346
View Source
const INCLUDE = 57351
View Source
const INTCONSTANT = 57348
View Source
const LIST = 57364
View Source
const LITERAL = 57347
View Source
const MAP = 57363
View Source
const NAMESPACE = 57350
View Source
const ONEWAY = 57366
View Source
const OPTIONAL = 57377
View Source
const REQUIRED = 57376
View Source
const SERVICE = 57373
View Source
const SET = 57365
View Source
const STRING = 57361
View Source
const STRUCT = 57368
View Source
const THROWS = 57372
View Source
const TRUE = 57378
View Source
const TYPEDEF = 57367
View Source
const UNION = 57369
View Source
const VOID = 57353

Variables

This section is empty.

Functions

func Parse

func Parse(s []byte) (ParseResult, []ParseError)

Parse parses the given Thrift document.

func ParseDocstring added in v1.7.0

func ParseDocstring(s string) string

ParseDocstring takes a docstring in the form,

/**
 * foo bar
 */

And returns,

foo bar

func UnquoteDoubleQuoted added in v1.27.0

func UnquoteDoubleQuoted(in []byte) (string, error)

UnquoteDoubleQuoted unquotes a slice of bytes representing a double quoted string.

UnquoteDoubleQuoted([]byte("\"foo\"")) == "foo"

func UnquoteSingleQuoted

func UnquoteSingleQuoted(in []byte) (string, error)

UnquoteSingleQuoted unquotes a slice of bytes representing a single quoted string.

UnquoteSingleQuoted([]byte("'foo'")) == "foo"

Types

type NodePositions added in v1.28.0

type NodePositions map[ast.Node]ast.Position

NodePositions maps (hashable) nodes to their document positions.

type ParseError added in v1.28.0

type ParseError struct {
	Pos ast.Position
	Err error
}

ParseError holds a parse error and the position that caused it.

type ParseResult added in v1.28.0

type ParseResult struct {
	Program       *ast.Program
	NodePositions NodePositions
}

ParseResult holds the result of a successful Parse.

Jump to

Keyboard shortcuts

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