bump(github.com/googleapis/gnostic):0c5108395e2de

Pick up performance improvements to OpenAPI serialization.
This commit is contained in:
Clayton Coleman
2017-07-31 01:24:19 -04:00
parent d8205661b7
commit 7a458730d7
18 changed files with 2099 additions and 309 deletions

View File

@@ -14,28 +14,30 @@
package compiler
// Context contains state of the compiler as it traverses a document.
type Context struct {
Parent *Context
Name string
ExtensionHandlers *[]ExtensionHandler
}
// NewContextWithExtensions returns a new object representing the compiler state
func NewContextWithExtensions(name string, parent *Context, extensionHandlers *[]ExtensionHandler) *Context {
return &Context{Name: name, Parent: parent, ExtensionHandlers: extensionHandlers}
}
// NewContext returns a new object representing the compiler state
func NewContext(name string, parent *Context) *Context {
if parent != nil {
return &Context{Name: name, Parent: parent, ExtensionHandlers: parent.ExtensionHandlers}
} else {
return &Context{Name: name, Parent: parent, ExtensionHandlers: nil}
}
return &Context{Name: name, Parent: parent, ExtensionHandlers: nil}
}
// Description returns a text description of the compiler state
func (context *Context) Description() string {
if context.Parent != nil {
return context.Parent.Description() + "." + context.Name
} else {
return context.Name
}
return context.Name
}