parser

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidationKeys

func GetValidationKeys(fname string, fset *token.FileSet, funcDecl *ast.FuncDecl, imports map[string]string) map[int]string

Scan app source code for calls to X.Y(), where X is of type *Validation.

Recognize these scenarios:

  • "Y" = "Validation" and is a member of the receiver. (The common case for inline validation)
  • "X" is passed in to the func as a parameter. (For structs implementing Validated)

The line number to which a validation call is attributed is that of the surrounding ExprStmt. This is so that it matches what runtime.Callers() reports.

The end result is that we can set the default validation key for each call to be the same as the local variable.

func ProcessSource

func ProcessSource(paths *model.RevelContainer) (_ *model.SourceInfo, compileError error)

ProcessSource parses the app controllers directory and returns a list of the controller types found. Otherwise CompileError if the parsing fails.

Types

This section is empty.

Jump to

Keyboard shortcuts

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