prettyprint

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

The prettyprint package visualises a Go AST, but only assignment nodes. In these nodes, it prints their position, the identifier and the identifier's declaration plus position.

It is used to visualise how assigncheck is checking for re-assignments.

To see it for yourself, run `go test -v .` in this directory.

$> go test -v .
=== RUN   TestRun
Assignment "x, y := 1, 2": 2958101
        Ident "x": 2958101
                Decl "x, y := 1, 2": 2958101
        Ident "y": 2958104
                Decl "x, y := 1, 2": 2958101
Assignment "y = 3": 2958115
        Ident "y": 2958115
                Decl "x, y := 1, 2": 2958101
--- PASS: TestRun (0.93s)
PASS
ok      github.com/tommyknows/funcheck/prettyprint      1.088s

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name: "prettyprint",
	Doc:  "prints positions",
	Run:  run,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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