state

package
Version: v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentCallback

type CommentCallback func(comment, filename string, lines []string, linecnt int) error

CommentCallback is a function which acts on an encountered comment

type CommentState

type CommentState int

CommentState is an enum representing the current state the traverser is in

const (
	// NonComment is the default state a traverser is at
	NonComment CommentState = iota

	// String is the state while the traverser is reading a string
	String

	// SingleLineComment is the state while the traverser is reading a single-line comment
	SingleLineComment

	// MultiLineComment is the state while the traverser is reading a multi-line comment
	MultiLineComment
)

type Func

type Func func(filepath, line string, linecnt int, prevToken, currToken, nextToken rune) (CommentState, error)

Func represents a state-transitioning function used in the state-machine design pattern Its parameters are tailored to traversing a file's stream of tokens

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL