docstring

package
v0.0.0-...-9ff31c3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

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

type Docstring

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

func Parse(s string) Docstring

Parse returns the AST of the given doc string.

func (*Docstring) Identifiers

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

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

func (*Identifier) NameAsCamelCase

func (i *Identifier) NameAsCamelCase() string

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

Jump to

Keyboard shortcuts

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