parser

package
v3.0.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 12 Imported by: 0

README

Parser

This package contains the static analyser used for parsing Wails projects so that we may:

  • Generate the bindings for the frontend
  • Generate Typescript definitions for the structs used by the bindings

Implemented

  • Parsing of structs
  • Generation of models
    • Scalars
    • Arrays
    • Maps
    • Structs
  • Generation of bindings

Limitations

There are many ways to write a Go program so there are many different program structures that we would need to support. This is a work in progress and will be improved over time. The current limitations are:

  • The call to application.New() must be in the main package
  • Bound structs must be declared as struct literals

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Functions

func GenerateModels

func GenerateModels(context *Context) ([]byte, error)

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func ParseDirectory

func ParseDirectory(dir string) (*Context, error)

func (*Context) GetBoundStructs

func (c *Context) GetBoundStructs() map[string][]*ast.TypeSpec

type Package

type Package struct {
	Name  string
	Specs []*ast.TypeSpec
}

Jump to

Keyboard shortcuts

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