CodeWriter

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionDecl

type FunctionDecl[T ffs.FStringer] struct {
	Name string
	Body []T
}

func (*FunctionDecl[T]) FString

func (fd *FunctionDecl[T]) FString(trav *ffs.Traversor, opts ...ffs.Option) error

WriteFunction writes a function with a body of CodeWritable values to a string.

Format:

func name() {
	instructions...
}

Parameters:

  • name: The name of the function.
  • body: The body of the function.
  • opts: Optional options to pass to the CodeWritable values.

Returns:

  • string: The string representation of the function.

Behaviors:

  • If the body is empty, the function will be written without a body.

type SliceDecl

type SliceDecl[T ffs.FStringer] struct {
	Name  string
	Slice []T
}

func (*SliceDecl[T]) FString

func (s *SliceDecl[T]) FString(trav *ffs.Traversor, opts ...ffs.Option) error

Jump to

Keyboard shortcuts

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