parser

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: MPL-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package parser parses Encore applications into an Encore Syntax Tree (EST).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMeta

func ParseMeta(appRevision string, appHasUncommittedChanges bool, appRoot string, app *est.Application) (*meta.Data, map[*est.Package]TraceNodes, error)

ParseMeta parses app metadata.

func SnakeCase added in v1.1.0

func SnakeCase(s string) string

SnakeCase converts CamelCase names to snake_case with lowercase letters and underscores. Names already in snake_case are left untouched. Adapted from github.com/pasztorpisti/qs.

Types

type Config

type Config struct {
	AppRoot                  string
	AppRevision              string
	AppHasUncommittedChanges bool
	ModulePath               string
	WorkingDir               string
	ParseTests               bool
}

Config represents the configuration options for parsing. TODO(domblack): Remove AppRevision and AppHasUncommittedChanges from here as it's compiler concern not a parser concern

type Result

type Result struct {
	FileSet *token.FileSet
	App     *est.Application
	Meta    *meta.Data
	Nodes   map[*est.Package]TraceNodes
}

func Parse

func Parse(cfg *Config) (*Result, error)

type TraceNodes

type TraceNodes map[ast.Node]*meta.TraceNode

Directories

Path Synopsis
Package est provides the Encore Syntax Tree (EST).
Package est provides the Encore Syntax Tree (EST).
Package paths parses API paths.
Package paths parses API paths.

Jump to

Keyboard shortcuts

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