docli: github.com/celicoo/docli/pkg/docstring Index | Files

package docstring

import "github.com/celicoo/docli/pkg/docstring"

Index

Package Files

docstring.go grammar.go

type Argument Uses

type Argument struct {
    Indentation string       `@('\n' (' '|'\t')+)`
    Identifiers []Identifier `@@+`
}

type Docstring Uses

type Docstring struct {
    Arguments []Argument `(@@|`
    // contains filtered or unexported fields
}

Docstring is both used as the grammar and the tree representation of the abstract syntactic structure of a doc string.

func Parse Uses

func Parse(s string) (d Docstring)

Parse returns the AST of the given doc string.

func (*Docstring) Identifiers Uses

func (d *Docstring) Identifiers(name string) (identifiers []Identifier)

Identifiers returns all identifiers of an argument if any of them match the given value.

type Identifier Uses

type Identifier struct {
    Name      string `@('-'|Let|Num)+`
    Separator string `@(',' ' ')?`
}

func (*Identifier) NameAsCamelCase Uses

func (i *Identifier) NameAsCamelCase() string

NameAsCamelCase returns the identifier's name as camel case. TODO(celicoo): improve this.

Package docstring imports 2 packages (graph) and is imported by 1 packages. Updated 2019-07-12. Refresh now. Tools for package owners.